#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2010, MAXK = 52, NINF = -0x01010102;
void setmax(int &a, int b) {
  if (a < b) {
    a = b;
  }
}
int N, P, K;
int dp[2][MAXN][MAXK][MAXK];
int R, S;
bool A[MAXN], B[MAXN];
int main() {
  scanf("%d %d %d %d", &N, &P, &K, &R);
  for (int i = 1, x; i <= R; i++) {
    scanf("%d", &x);
    A[x] = true;
  }
  scanf("%d", &S);
  for (int i = 1, x; i <= S; i++) {
    scanf("%d", &x);
    B[x] = true;
  }
  int ans = 0;
  if (P >= 2 * ((N - 1) / K + 1)) {
    for (int i = 1; i <= N; i++) {
      ans += (A[i] || B[i]);
    }
    printf("%d\n", ans);
    return 0;
  }
  memset(dp, -2, sizeof(dp));
  dp[0][0][0][0] = 0;
  int cur = 0, prv = 1;
  for (int i = 0; i <= N; i++) {
    swap(cur, prv);
    for (int j = 0; j <= P; j++) {
      for (int k = 0; k <= K; k++) {
        for (int m = 0; m <= K; m++) {
          dp[cur][j][k][m] = NINF;
        }
      }
    }
    for (int j = 0; j <= P; j++) {
      for (int k = 0; k <= K; k++) {
        for (int m = 0; m <= K; m++) {
          int pdp = dp[prv][j][k][m];
          if (pdp < 0) {
            continue;
          }
          setmax(ans, pdp);
          if (i == N) {
            continue;
          }
          for (int s = 0; s < 2; s++) {
            if (s && k > 1) {
              continue;
            }
            for (int t = 0; t < 2; t++) {
              if (t && m > 1) {
                continue;
              }
              int nj = j + s + t;
              if (nj > P) {
                continue;
              }
              int nk = (s ? K : max(0, k - 1)), nm = (t ? K : max(0, m - 1));
              setmax(dp[cur][nj][nk][nm],
                     pdp + ((nk && A[i + 1]) || (nm && B[i + 1])));
            }
          }
        }
      }
    }
  }
  printf("%d\n", ans);
}
