#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int M = 1e7 + 5;
const int inf = 1e9 + 5;
int n, m, ymouse, ycheese, mouse[N], cheese[N], dp[N][2];
pair<int, int> owner[N], lmao[N][2];
vector<int> pts[N];
int main() {
  cin.tie(0), ios_base::sync_with_stdio(0);
  cin >> n >> m >> ymouse >> ycheese;
  for (int i = 1; i <= n; i++) cin >> mouse[i];
  for (int i = 1; i <= m; i++) {
    cin >> cheese[i];
    owner[i].first = M;
  }
  int pter = 1;
  for (int i = 1; i <= n; i++) {
    while (pter + 1 <= m && cheese[pter + 1] <= mouse[i]) pter++;
    if (pter > m) continue;
    if (pter + 1 > m && pter <= m && pter > 0)
      pts[i].push_back(cheese[pter]);
    else {
      if (abs(mouse[i] - cheese[pter]) < abs(mouse[i] - cheese[pter + 1]))
        pts[i].push_back(cheese[pter]);
      else if (abs(mouse[i] - cheese[pter]) > abs(mouse[i] - cheese[pter + 1]))
        pts[i].push_back(cheese[pter + 1]);
      else {
        pts[i].push_back(cheese[pter]);
        pts[i].push_back(cheese[pter + 1]);
      }
    }
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < 2; j++) dp[i][j] = -inf;
  }
  for (int i = 0; i < pts[1].size(); i++) dp[1][i] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 2; j++) {
      if (dp[i][j] > -inf) {
        for (int k = 0; k < pts[i + 1].size(); k++) {
          if (pts[i + 1][k] == pts[i][j])
            dp[i + 1][k] =
                max(dp[i + 1][k], dp[i][j] + (abs(mouse[i] - pts[i][j]) ==
                                              abs(mouse[i + 1] - pts[i][j])));
          else
            dp[i + 1][k] = max(dp[i + 1][k], dp[i][j] + 1);
        }
      }
    }
  }
  cout << n - max(dp[n][0], dp[n][1]);
}
