#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n, m, tmp1, tmp2;
int a[maxn], b[maxn], v[maxn], r[maxn];
int f[maxn][2];
inline int calc(int l, int r, int i) {
  if (l > r) return 0;
  int pos = lower_bound(a + l, a + r + 1, b[i]) - a;
  if (pos <= r && pos > l && a[pos] - b[i] == b[i] - a[pos - 1])
    return r - l - 1;
  return r - l;
}
int main() {
  scanf("%d%d%d%d", &n, &m, &tmp1, &tmp2);
  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 <= (n); ++i) {
    int pos = lower_bound(b + 1, b + m + 1, a[i]) - b;
    if (pos > m)
      r[m] = i;
    else if (pos - 1 >= 1) {
      if (b[pos] - a[i] < a[i] - b[pos - 1])
        r[pos] = i;
      else if (b[pos] - a[i] > a[i] - b[pos - 1])
        r[pos - 1] = i;
      else {
        r[pos] = i;
        ++v[pos - 1];
      }
    } else
      r[1] = i;
  }
  for (int i = (1); i <= (m); ++i) r[i] = max(r[i], r[i - 1]);
  memset(f, 0x3f, sizeof(f));
  f[0][0] = f[0][1] = 0;
  for (int i = (1); i <= (m); ++i)
    for (int j = (0); j <= (v[i]); ++j)
      for (int k = (0); k <= (v[i - 1]); ++k)
        f[i][j] =
            min(f[i][j], f[i - 1][k] + calc(r[i - 1] + k + 1, r[i] + j, i));
  printf("%d\n", f[m][0]);
  return 0;
}
