#include <bits/stdc++.h>using namespace std;
const int N = 1e6 + 5;
int a[N], pre[N];
int main() {
//freopen("car.in","r",stdin); //freopen("car.out","w",stdout);ios::sync_with_stdio(false);
cin.tie(NULL);
int n, b, k;
cin >> n >> b >> k;
for (int i = 0; i < k; i++) {
int t;
cin >> t;
a[t] = 1;
}
for (int i = 1; i <= n; i++) {
pre[i] = pre[i - 1] + a[i];
}
int mi = k + 1;
for (int i = 1; i + b - 1 <= n; i++) {
int sum = pre[i + b - 1] - pre[i - 1];
mi = min(mi, sum);
}
cout << mi;
return 0;
}
#include <bits/stdc++.h>using namespace std;
const int N=1005;
long long st[N];
int top=0;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
string s;
while (cin >> s) {
if (s == "C") {
if(top>0) top--;
}else if (s == "D") {
if(top>0){
st[top]=st[top-1]*2;
top++;
}
}else if (s == "+") {
if(top>=2){
long long a=st[top-1];
long long b=st[top-2];
st[top]=a+b;
top++;
}
}else{
st[top]=stoll(s);
top++;
}
}
long long ans=0;
for(int i=0;i<top;i++){
ans+=st[i];
}
cout<<ans<<endl;
return 0;
}