#include <iostream>
using namespace std;
int main() {
  int n,q,x,y,z;
  cin>>n;
  cin>>q;
  int a[n];
  int b[q];
  for(int i=0;i<n;i=i+1){
    cin>>a[i];
  }
  for(int i=0;i<q;i=i+1){
    cin>>b[i];
  }
  for(int i=0;i<q;i=i+1){
    z = b[i];
    for(int i=0;i<n-1;i=i+1){
    for(int j=i+1;j<n;j++){
      if(a[j]<a[i]){
        int temp=a[j];
        a[j]=a[i];
        a[i]=temp;
      }
    }
  }
  x = 0;
  for(int i = n/2;i<n;i++){
    if(a[i]==z){
      x=i+1;
      break;
      }
  }
  cout<<endl;
  if(x==0){
    y=n;
    cout<<n;
  }
  else if(x==n/2+1){
    cout<<"0";
  }
  else{
    y=(x-1)*2-n;
    cout<<y;
  }
  }
}