#include <iostream>
#include <cassert>
using namespace std;
const int MAXN = 1000000000;
const int MAXM = 10;
typedef long long i64;
const int T = 1 << 10;
int a[T], c[T];i64 b[T];
int main() 
{	freopen("B.in", "r", stdin);	
freopen("B.out", "w", stdout);	
int n, m, k, l;	cin >> n >> m >> k >> l;	
assert((1 <= n) && (n <= MAXN) && (1 <= m) && (m <= MAXM) && (1 <= k) && (k <= m) && (1 <= l) && (l <= k));	
int mask = 0;	
for (int i = 0; i < l; ++i) 
{		int x; cin >> x;		
assert((1 <= x) && (x <= k) && !(mask & (1 << (x - 1))));		
mask |= (1 << (x - 1));	}	
for (int i = 0; i < 1 << k; ++i) b[i] = -1;	
i64 result = -1;	int u = 0;	int f = -1;	
for (int i = 0; i < n; ++i) {		
for (int j = 0; j < k; ++j) {			
++result;			
u >>= 1;			
if ((u & mask) == 0) break;		}		
u|= mask;		
assert(u < (1 << k));		
if (b[u] != -1) {			
f = i;			
break;		}		
a[i] = u;		
b[u] = result;		
c[u] = i;	}	
if (f != -1) result += (result - b[u]) * ((n - f - 1) / (f - c[u])) + b[a[c[u] + (n - f - 1) % (f - c[u])]] - b[u];	
cout << result + k << endl;	
return 0; }
