#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:264777216")
int n, m;
const int size = 100100;
int x0[size], x1[size];
long long dis(unsigned long long x1, unsigned long long x2) {
  return (x1 - x2) * (x1 - x2);
}
vector<int> v[size];
map<int, int> dp[size];
int rec(int V, int U) {
  if (V < 0) return 0;
  if (dp[V].find(U) != dp[V].end()) return dp[V][U];
  int res = 0;
  for (int i = 0; i < v[V].size(); ++i) {
    if (v[V][i] == U && dis(x0[V], x1[U]) == dis(x0[V + 1], x1[U])) {
      res = max(res, rec(V - 1, v[V][i]) + 1);
    } else if (v[V][i] == U) {
      res = max(res, rec(V - 1, v[V][i]));
    } else {
      res = max(res, rec(V - 1, v[V][i]) + 1);
    }
  }
  dp[V][U] = res;
  return res;
}
void Solve() {
  cin >> n >> m;
  int y0, y1;
  cin >> y0 >> y1;
  for (int i = 0; i < n; ++i) cin >> x0[i];
  for (int i = 0; i < m; ++i) cin >> x1[i];
  if (m != 0)
    for (int i = 0; i < n; ++i) {
      int index = lower_bound(x1, x1 + m, x0[i]) - x1;
      if (index >= m) --index;
      long long rd = dis(x0[i], x1[index]);
      if (index - 1 >= 0) rd = min(rd, dis(x0[i], x1[index - 1]));
      if (index + 1 < m) rd = min(rd, dis(x0[i], x1[index + 1]));
      for (int j = max(0, index - 1); j <= min(index + 1, m - 1); ++j) {
        if (rd == dis(x0[i], x1[j])) {
          v[i].push_back(j);
        }
      }
    }
  int res = 0;
  res = max(res, rec(n - 1, -1));
  cout << n - res;
}
int main() {
  Solve();
  return 0;
}
