#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:65777216")
using namespace std;
const int inf = 1000000000;
int n, m, y, Y;
int x[111111], X[111111];
int d[111111][2];
vector<int> v[111111];
int main() {
  cin >> n >> m >> y >> Y;
  for (int i(0); i < (n); i++) scanf("%d", x + i);
  for (int i(0); i < (m); i++) scanf("%d", X + i);
  for (int i(0); i < (n); i++) d[i][0] = d[i][1] = inf;
  for (int i(0); i < (n); i++) {
    int pos = lower_bound(X, X + m, x[i]) - X;
    if (pos >= m)
      pos--;
    else {
      if (pos >= 1) {
        if (X[pos] - x[i] > x[i] - X[pos - 1]) pos--;
      }
    }
    if (pos >= 1 && X[pos] - x[i] == x[i] - X[pos - 1]) {
      v[i].push_back(pos - 1);
      v[i].push_back(pos);
      pos--;
      if (i == 0)
        d[0][0] = d[0][1] = 0;
      else {
        d[i][1] = min(d[i - 1][0], d[i - 1][1]);
        if (v[i - 1].size() == 2) {
          if (v[i - 1].back() == pos)
            d[i][0] =
                min(d[i - 1][0],
                    d[i - 1][1] + (x[i - 1] + x[i] != X[pos] * 2 ? 1 : 0));
          else
            d[i][0] = min(d[i - 1][0], d[i - 1][1]);
        } else {
          if (v[i - 1][0] == pos)
            d[i][0] = d[i - 1][0] + (x[i - 1] + x[i] != X[pos] * 2 ? 1 : 0);
          else
            d[i][0] = d[i - 1][0];
        }
      }
    } else {
      v[i].push_back(pos);
      if (i == 0) {
        d[0][0] = 0;
      } else {
        if (v[i - 1].size() == 2) {
          if (v[i - 1].back() == pos)
            d[i][0] =
                min(d[i - 1][0],
                    d[i - 1][1] + (x[i - 1] + x[i] != X[pos] * 2 ? 1 : 0));
          else
            d[i][0] = min(d[i - 1][0], d[i - 1][1]);
        } else {
          if (v[i - 1][0] == pos)
            d[i][0] = d[i - 1][0] + (x[i - 1] + x[i] != X[pos] * 2 ? 1 : 0);
          else
            d[i][0] = d[i - 1][0];
        }
      }
    }
  }
  cout << min(d[n - 1][0], d[n - 1][1]) << endl;
  return 0;
}
