#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1005;
int n, p, k, r, s, ans, a[MAXN], b[MAXN];
int f[2][MAXN][55][55];
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    (x *= 10) += ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline void ckmax(int &x, int y) {
  if (x < y) x = y;
}
int main() {
  n = read(), p = read(), k = read();
  r = read();
  for (int i = 1; i <= r; i++) a[read()] = 1;
  s = read();
  for (int i = 1; i <= s; i++) b[read()] = 1;
  if (p >= 2 * ((n + k - 1) / k)) {
    for (int i = 1; i <= n; i++) ans += a[i] | b[i];
    return printf("%d\n", ans), 0;
  }
  memset(f, -0x3f, sizeof(f));
  f[0][p][0][0] = 0;
  int now = 0, nxt = 1;
  for (int i = 1; i <= n; i++) {
    memset(f[nxt], -0x3f, sizeof(f[nxt]));
    for (int j = 0; j <= p; j++)
      for (int t = 0; t < k; t++)
        for (int y = 0; y < k; y++)
          if (f[now][j][t][y] >= 0) {
            ckmax(f[nxt][j][max(t - 1, 0)][max(y - 1, 0)],
                  f[now][j][t][y] + ((t > 0 && a[i]) || (y > 0 && b[i])));
            if (j > 0) {
              if (a[i])
                ckmax(f[nxt][j - 1][k - 1][max(y - 1, 0)], f[now][j][t][y] + 1);
              if (b[i])
                ckmax(f[nxt][j - 1][max(t - 1, 0)][k - 1], f[now][j][t][y] + 1);
            }
          }
    swap(now, nxt);
  }
  for (int j = 0; j <= p; j++)
    for (int t = 0; t < k; t++)
      for (int y = 0; y < k; y++) ans = max(ans, f[now][j][t][y]);
  printf("%d\n", ans);
  return 0;
}
