using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace namestanjeglasova
{
    class Program
    {
        static void Main(string[] args)
        {
            string nq = Console.ReadLine();
            string[] val = nq.Split(' ');
            int N = int.Parse(val[0]);
            int Q = int.Parse(val[1]);
            int i, j, p;
            int manji = 0, veci = 0, jednaki=0;
            string a, b;
            string[] val2, val3;
            int[] A = new int[N];
            int[] B = new int[Q];
            a = Console.ReadLine();
            val2 = a.Split(' ');
            for (i = 0; i < N; i++)
            {
                A[i] = int.Parse(val2[i]);
            }
            b = Console.ReadLine();
            val3 = b.Split(' ');
            for (i = 0; i < Q; i++)
                B[i] = int.Parse(val3[i]);
            for(i=1;i<N;i++)
                for(j=i-1;j>=0&&A[j]>A[j+1];j--)
                {
                    p = A[j];
                    A[j] = A[j + 1];
                    A[j + 1] = p;
                }
            for (i = 0; i < Q; i++)
            {

                for(j=0;j<N;j++)
                {
                    if (B[i] > A[j])
                        manji++;
                    else if (B[i] < A[j])
                        veci++;
                    else if (B[i] == A[j])
                        jednaki++;
                }        
                if (manji == veci)
                    Console.WriteLine("0");
                else if (manji > veci)
                    Console.WriteLine((manji - veci-jednaki));
                else 
                    Console.WriteLine((veci - manji));
                manji = 0;
                veci = 0;
                jednaki = 0;
            }
        }
    }
}