#include <bits/stdc++.h>
using namespace std;
int n, p, k, la, lb, ans = 0, x, y = 1, a[1010], b[1010], dp[2][1010][60][60];
int main() {
  cin >> n >> p >> k;
  memset(dp, -0x3f, sizeof(dp));
  dp[0][0][0][0] = 0;
  cin >> la;
  for (int i = 1; i <= la; i++) scanf("%d", &x), a[x] = 1;
  cin >> lb;
  for (int i = 1; i <= lb; i++) scanf("%d", &x), b[x] = 1;
  if (p * k >= 2 * n) {
    for (int i = 1; i <= n; i++) ans += a[i] | b[i];
    return printf("%d\n", ans), 0;
  }
  for (int i = 1; i <= n; i++) {
    x = y, y ^= 1;
    memset(dp[x], -0x3f, sizeof(dp[x]));
    for (int j = 0; j <= p; j++)
      for (int ii = 0; ii <= k; ii++)
        for (int jj = 0; jj <= k; jj++)
          if (!ii && !jj) {
            dp[x][j][0][0] = max(dp[x][j][0][0], dp[y][j][0][0]);
            dp[x][j + 1][k - 1][0] =
                max(dp[x][j + 1][k - 1][0], dp[y][j][0][0] + a[i]);
            dp[x][j + 1][0][k - 1] =
                max(dp[x][j + 1][0][k - 1], dp[y][j][0][0] + b[i]);
            dp[x][j + 2][k - 1][k - 1] =
                max(dp[x][j + 2][k - 1][k - 1], dp[y][j][0][0] + (a[i] | b[i]));
          } else if (!ii) {
            dp[x][j][0][jj - 1] =
                max(dp[x][j][0][jj - 1], dp[y][j][0][jj] + b[i]);
            dp[x][j + 1][k - 1][jj - 1] = max(dp[x][j + 1][k - 1][jj - 1],
                                              dp[y][j][0][jj] + (a[i] | b[i]));
            dp[x][j + 2][k - 1][k - 1] = max(dp[x][j + 2][k - 1][k - 1],
                                             dp[y][j][0][jj] + (a[i] | b[i]));
          } else if (!jj) {
            dp[x][j][ii - 1][0] =
                max(dp[x][j][ii - 1][0], dp[y][j][ii][0] + a[i]);
            dp[x][j + 1][ii - 1][k - 1] = max(dp[x][j + 1][ii - 1][k - 1],
                                              dp[y][j][ii][0] + (a[i] | b[i]));
            dp[x][j + 2][k - 1][k - 1] = max(dp[x][j + 2][k - 1][k - 1],
                                             dp[y][j][ii][0] + (a[i] | b[i]));
          } else
            dp[x][j][ii - 1][jj - 1] =
                max(dp[x][j][ii - 1][jj - 1], dp[y][j][ii][jj] + (a[i] | b[i]));
  }
  for (int l = 0; l <= p; l++)
    for (int i = 0; i <= k; i++)
      for (int j = 0; j <= k; j++) ans = max(ans, dp[x][l][i][j]);
  cout << ans;
}
