#include <bits/stdc++.h>
using namespace std;
const int N = 1001;
template <typename T>
inline void read(T& x) {
  x = 0;
  T fl = 1;
  char ch = 0;
  for (; ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') fl = -1;
  for (; ch >= '0' && ch <= '9'; ch = getchar())
    x = (x << 1) + (x << 3) + (ch ^ 48);
  x *= fl;
}
template <typename T, typename... Args>
inline void read(T& x, Args&... args) {
  read(x);
  read(args...);
}
short dp[N][N][51][2];
int sum[3][N], a[3][N];
int n, k, p, r, s;
short dfs(int x, int res, int len, int type) {
  if (x > n) return 0;
  if (res == 0) return sum[type][x + len - 1] - sum[type][x - 1];
  if (dp[x][res][len][type] != -1) return dp[x][res][len][type];
  short& ans = dp[x][res][len][type];
  ans = 0;
  int LEN = min(k, n - x + 1);
  if (len == 0) {
    ans = (short)dfs(x + 1, res, len, type);
    ans = max(ans, (short)dfs(x, res - 1, LEN, 0));
    ans = max(ans, (short)dfs(x, res - 1, LEN, 1));
  } else {
    ans = max(ans, (short)((short)dfs(x + 1, res, len - 1, type) +
                           (short)a[type][x]));
    ans = max(ans, (short)((short)dfs(x + len, res - 1, LEN - len, 1 - type) +
                           (short)(sum[2][x + len - 1] - sum[2][x - 1])));
  }
  return ans;
}
int main() {
  memset(dp, -1, sizeof(dp));
  read(n, p, k);
  read(r);
  for (int i = 1, x; i <= r; i++) {
    read(x);
    a[0][x] = 1;
  }
  read(s);
  for (int i = 1, x; i <= s; i++) {
    read(x);
    a[1][x] = 1;
  }
  for (int i = 1; i <= n; i++) {
    sum[0][i] += sum[0][i - 1] + a[0][i];
    sum[1][i] += sum[1][i - 1] + a[1][i];
    sum[2][i] += sum[2][i - 1];
    if (a[0][i] || a[1][i]) sum[2][i]++;
  }
  cout << dfs(1, p, 0, 0) << endl;
  return 0;
}
