#include <bits/stdc++.h>
using namespace std;
const long long MAX_N = 1e5 + 5, inf = 1000000LL * 1000000LL * 1000000LL;
long long n, m, X0, X1, ans;
long long Yn[MAX_N], Ym[MAX_N];
long long MT[MAX_N];
long long cnt[MAX_N];
pair<pair<long long, long long>, long long> mic[MAX_N];
long long IND = 1;
long long dp[MAX_N][2];
void upd(long long ind, long long dis) {
  if (MT[ind] < dis) {
    ans++;
    return;
  }
  if (MT[ind] == dis) {
    cnt[ind]++;
    return;
  }
  ans += cnt[ind];
  MT[ind] = dis;
  cnt[ind] = 1;
}
long long calc(long long dis, long long ind) {
  if (dis < MT[ind]) return cnt[ind];
  if (dis == MT[ind]) return 0;
  return 1;
}
long long CALC(long long dis1, long long dis2, long long ind) {
  if (dis1 == dis2) {
    if (dis1 < MT[ind]) return cnt[ind];
    if (dis1 == MT[ind]) return 0;
    return 2;
  }
  dis1 = min(dis1, dis2);
  if (dis1 < MT[ind]) return cnt[ind] + 1;
  if (dis1 == MT[ind]) return 1;
  return 2;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  for (long long i = 0; i < MAX_N; i++) MT[i] = inf;
  cin >> n >> m >> X0 >> X1;
  if (!m) {
    cout << n << "\n";
    return 0;
  }
  for (long long i = 0; i < n; i++) cin >> Yn[i];
  for (long long i = 0; i < m; i++) cin >> Ym[i];
  long long ind = 0;
  for (long long i = 0; i < n; i++) {
    while (ind + 1 < m && Ym[ind + 1] <= Yn[i]) ind++;
    long long dis1 = inf, dis2 = inf, ind2 = 0;
    if (Ym[ind] <= Yn[i])
      dis1 = (X1 - X0) * (X1 - X0) + (Yn[i] - Ym[ind]) * (Yn[i] - Ym[ind]);
    if (Ym[ind] > Yn[i]) {
      dis2 = (X1 - X0) * (X1 - X0) + (Yn[i] - Ym[ind]) * (Yn[i] - Ym[ind]);
      ind2 = ind;
    } else {
      if (ind + 1 < m) {
        ind2 = ind + 1;
        dis2 = (X1 - X0) * (X1 - X0) +
               (Yn[i] - Ym[ind + 1]) * (Yn[i] - Ym[ind + 1]);
      }
    }
    if (dis1 != dis2) {
      if (dis1 < dis2)
        upd(ind, dis1);
      else
        upd(ind2, dis2);
    } else
      mic[IND++] = {{ind, ind2}, dis1};
  }
  mic[0] = {{-1, -1}, -1};
  for (long long i = 1; i < IND; i++) {
    dp[i][1] = calc(mic[i].second, mic[i].first.second) +
               min(dp[i - 1][0], dp[i - 1][1]);
    if (mic[i].first.first != mic[i - 1].first.second)
      dp[i][0] = calc(mic[i].second, mic[i].first.first) +
                 min(dp[i - 1][0], dp[i - 1][1]);
    else {
      dp[i][0] = calc(mic[i].second, mic[i].first.first) + dp[i - 1][0];
      long long tmp =
          CALC(mic[i].second, mic[i - 1].second, mic[i].first.first);
      if (1 < i) tmp += min(dp[i - 2][0], dp[i - 2][1]);
      dp[i][0] = min(dp[i][0], tmp);
    }
  }
  ans += min(dp[IND - 1][0], dp[IND - 1][1]);
  cout << ans << "\n";
  return 0;
}
