#include <bits/stdc++.h>
using namespace std;
int n, p, k, r;
short dp[1009][1009][51][2];
int ase_kina[2][1009], pre[3][1009 + 2];
short f(int idx, int baki, int ex, int typ) {
  if (idx > n) return 0;
  if (baki == 0) {
    return pre[typ][idx + ex - 1] - pre[typ][idx - 1];
  }
  if (dp[idx][baki][ex][typ] != (-1)) return dp[idx][baki][ex][typ];
  short& ret = dp[idx][baki][ex][typ];
  ret = 0;
  int barbe = min(k, n - idx + 1);
  if (ex == 0) {
    ret = f(idx + 1, baki, ex, typ);
    ret = max(ret, f(idx, baki - 1, barbe, 0));
    ret = max(ret, f(idx, baki - 1, barbe, 1));
  } else {
    ret = max(ret,
              (short)(f(idx + 1, baki, ex - 1, typ) + (int)ase_kina[typ][idx]));
    ret = max(ret, (short)(f(idx + ex, baki - 1, barbe - ex, 1 - typ) +
                           (int)(pre[2][idx + ex - 1] - pre[2][idx - 1])));
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  memset(dp, -1, sizeof dp);
  cin >> n >> p >> k >> r;
  for (int i = 0; i < r; i++) {
    int x;
    cin >> x;
    ase_kina[0][x] = 1;
  }
  cin >> r;
  for (int i = 0; i < r; i++) {
    int x;
    cin >> x;
    ase_kina[1][x] = 1;
  }
  for (int i = 1; i <= n; i++) {
    pre[2][i] += pre[2][i - 1];
    if (ase_kina[0][i] || ase_kina[1][i]) pre[2][i]++;
    for (int j = 0; j < 2; j++) {
      pre[j][i] += ase_kina[j][i] + pre[j][i - 1];
    }
  }
  cout << f(1, p, 0, 0) << endl;
  return 0;
}
