#include <bits/stdc++.h>
using namespace std;
int n, m, a[101010], b[101010], r[101010], v[101010], dp[101010][2];
int js(int l, int r, int i) {
  if (l > r) {
    return 0;
  }
  int rt = r - l, p = lower_bound(a + l, a + r + 1, b[i]) - a;
  if (p <= r && p >= l + 1 && a[p] - b[i] == b[i] - a[p - 1]) {
    rt--;
  }
  return rt;
}
int main() {
  int yy1, yy2;
  cin >> n >> m >> yy1 >> yy2;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= m; i++) {
    cin >> b[i];
  }
  for (int i = 1; i <= n; i++) {
    int p = lower_bound(b + 1, b + m + 1, a[i]) - b;
    if (p > m) {
      r[m] = i;
    } else if (p >= 2) {
      if (a[i] - b[p - 1] < b[p] - a[i]) {
        r[p - 1] = i;
      } else if (a[i] - b[p - 1] == b[p] - a[i]) {
        v[p - 1]++;
        r[p] = i;
      } else {
        r[p] = i;
      }
    } else {
      r[1] = i;
    }
  }
  for (int i = 1; i <= m; i++) {
    r[i] = max(r[i], r[i - 1]);
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 0; j <= v[i]; j++) {
      dp[i][j] = 1e9;
      for (int k = 0; k <= v[i - 1]; k++) {
        dp[i][j] =
            min(dp[i][j], dp[i - 1][k] + js(r[i - 1] + 1 + k, r[i] + j, i));
      }
    }
  }
  cout << dp[m][0];
  return 0;
}
