#include <bits/stdc++.h>
using namespace std;
const int maxn = 1001;
int n, p, l, r, m, t, now, la;
short dp[2][maxn][51][51];
bool a[maxn], b[maxn];
inline void updMax(short &a, short b) {
  if (a < b) a = b;
}
int main() {
  scanf("%d%d%d%d", &n, &p, &l, &m);
  p = min(p, ((n + l - 1) / l) << 1);
  while (m--) {
    scanf("%d", &t);
    a[t] = 1;
  }
  scanf("%d", &m);
  while (m--) {
    scanf("%d", &t);
    b[t] = 1;
  }
  memset(dp, 0xaf, sizeof dp);
  dp[la][0][0][0] = 0;
  now = 1, la = 0;
  for (int i = 0; i <= n; ++i) {
    for (int j = 0; j <= p; ++j)
      for (int o = 0; o <= l; ++o)
        for (int e = 0; e <= l; ++e) {
          int to = max(0, o - 1), te = max(0, e - 1);
          updMax(dp[now][j][to][te],
                 dp[la][j][o][e] + ((a[i] && to) || (b[i] && te)));
          updMax(dp[now][j + 1][to][l],
                 dp[la][j][o][e] + ((a[i] && to) || b[i]));
          updMax(dp[now][j + 1][l][te],
                 dp[la][j][o][e] + (a[i] || (b[i] && te)));
        }
    swap(now, la);
    memset(dp[now], 0xaf, sizeof dp[now]);
  }
  short res = 0;
  for (int i = 1; i <= p; ++i)
    for (int j = 0; j <= l; ++j)
      for (int k = 0; k <= l; ++k) updMax(res, dp[la][i][j][k]);
  printf("%d\n", res);
  return 0;
}
