#include <bits/stdc++.h>
using namespace std;
int n, p, K, a[1010], b[1010], dp[2][1010][60][60];
inline int read() {
  int s = 0, w = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') w = -1;
  for (; isdigit(c); c = getchar()) s = (s << 1) + (s << 3) + (c ^ 48);
  return s * w;
}
void upd(int &x, int y) {
  if (x < y) x = y;
}
int main() {
  n = read(), p = read(), K = read();
  int x = read();
  for (int i = 1; i <= x; ++i) {
    int y = read();
    a[y] = 1;
  }
  x = read();
  for (int i = 1; i <= x; ++i) {
    int y = read();
    b[y] = 1;
  }
  if (p * K >= (n << 1)) {
    int ans = 0;
    for (int i = 1; i <= n; ++i) ans += a[i] | b[i];
    return printf("%d\n", ans), 0;
  }
  memset(dp, -0x3f, sizeof(dp));
  dp[0][0][0][0] = 0;
  for (int i = 1; i <= n; ++i) {
    int now = i & 1, pre = now ^ 1;
    memset(dp[now], -0x3f, sizeof(dp[now]));
    for (int j = 0; j <= p; ++j)
      for (int k = 0; k <= K; ++k)
        for (int l = 0; l <= K; ++l) {
          int tmp = dp[pre][j][k][l];
          upd(dp[now][j][max(k - 1, 0)][max(l - 1, 0)], tmp);
          if (k) upd(dp[now][j][k - 1][max(l - 1, 0)], tmp + a[i]);
          upd(dp[now][j + 1][K - 1][max(l - 1, 0)], tmp + a[i]);
          if (l) upd(dp[now][j][max(k - 1, 0)][l - 1], tmp + b[i]);
          upd(dp[now][j + 1][max(k - 1, 0)][K - 1], tmp + b[i]);
          if (k && l) upd(dp[now][j][k - 1][l - 1], tmp + (a[i] | b[i]));
          if (k) upd(dp[now][j + 1][k - 1][K - 1], tmp + (a[i] | b[i]));
          if (l) upd(dp[now][j + 1][K - 1][l - 1], tmp + (a[i] | b[i]));
          upd(dp[now][j + 2][K - 1][K - 1], tmp + (a[i] | b[i]));
        }
  }
  int ans = 0;
  for (int j = 0; j <= p; ++j)
    for (int k = 0; k <= K; ++k)
      for (int l = 0; l <= K; ++l) upd(ans, dp[n & 1][j][k][l]);
  printf("%d\n", ans);
  return 0;
}
