#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, m, Y0, Y1, ans;
int a[N], b[N], used[N];
int main() {
  scanf("%d%d%d%d", &n, &m, &Y0, &Y1);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  for (int i = 1; i <= m; i++) scanf("%d", b + i);
  for (int i = 1; i <= m; i++) used[i] = -1;
  for (int i = 1; i <= n; i++) {
    int r = lower_bound(b + 1, b + 1 + m, a[i]) - b;
    int l = r - 1;
    if (l == 0) {
      if (!~used[r])
        used[r] = b[r] - a[i];
      else if (used[r] != b[r] - a[i]) {
        ans++;
        used[r] = min(used[r], b[r] - a[i]);
      }
    } else if (r == m + 1) {
      if (!~used[l])
        used[l] = a[i] - b[l];
      else if (used[l] != a[i] - b[l]) {
        ans++;
        used[l] = min(used[l], a[i] - b[l]);
      }
    } else if (a[i] - b[l] < b[r] - a[i]) {
      if (!~used[l])
        used[l] = a[i] - b[l];
      else if (used[l] != a[i] - b[l]) {
        ans++;
        used[l] = min(used[l], a[i] - b[l]);
      }
    } else if (a[i] - b[l] > b[r] - a[i]) {
      if (!~used[r])
        used[r] = b[r] - a[i];
      else if (used[r] != b[r] - a[i]) {
        ans++;
        used[r] = min(used[r], b[r] - a[i]);
      }
    } else if (!~used[l] || used[l] == a[i] - b[l])
      used[l] = a[i] - b[l];
    else
      used[r] = b[r] - a[i];
  }
  printf("%d\n", ans);
  return 0;
}
