#include <bits/stdc++.h>
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using namespace std;
const int N = 100005;
multiset<int> st[N];
int f[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  fill(f, f + N, -1);
  int n, m, y1, y2;
  cin >> n >> m >> y1 >> y2;
  vector<int> p1(n), p2(m);
  for (int& i : p1) {
    cin >> i;
  }
  for (int& i : p2) {
    cin >> i;
  }
  sort((p1).begin(), (p1).end());
  sort((p2).begin(), (p2).end());
  vector<pair<int, int>> can;
  for (int i = 0; i < n; ++i) {
    int l = -1, r = m;
    while (r - l > 1) {
      int mid = (l + r) / 2;
      if (p2[mid] < p1[i]) {
        l = mid;
      } else {
        r = mid;
      }
    }
    if (l == -1) {
      st[l + 1].insert(abs(p1[i] - p2[l + 1]));
    } else {
      if (l + 1 < m) {
        int d1 = abs(p1[i] - p2[l]);
        int d2 = abs(p1[i] - p2[l + 1]);
        if (d1 < d2) {
          st[l].insert(d1);
        } else if (d2 < d1) {
          st[l + 1].insert(d2);
        } else {
          can.push_back({l, d1});
        }
      } else {
        st[l].insert(abs(p1[i] - p2[l]));
      }
    }
  }
  int res = 0;
  for (int i = 0; i < N; ++i) {
    if (st[i].size()) {
      int mn = *st[i].begin();
      for (int j : st[i]) {
        if (j != mn) res++;
      }
      f[i] = mn;
    }
  }
  for (auto i : can) {
    if (f[i.first] == i.second) {
      continue;
    }
    if (f[i.first + 1] == i.second) {
      continue;
    }
    if (f[i.first] == -1) {
      f[i.first] = i.second;
      continue;
    }
    if (f[i.first + 1] == -1) {
      f[i.first + 1] = i.second;
      continue;
    }
    res++;
  }
  cout << res;
  return 0;
}
