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