#include <iostream>
using namespace std;
int main()
{
int ans, s, t, n, ticket, tmp, i, p20, p40, p60;
while ( scanf("%d%d%d",&s,&t,&n) != EOF ) {
ticket = 0;
ans = -int(s*t*0.3+0.5);
while ( n-- ) {
scanf("%d",&tmp);
ticket += tmp;
}
p20 = int(t*0.2+0.5);
p40 = int(t*0.4+0.5);
p60 = int(t*0.6+0.5);
for( i = 1; i <= ticket; i++ ) {
if ( i <= p20 )
ans += int(s*0.7+0.5);
else if ( i <= p40 )
ans += int(s*0.8+0.5);
else if ( i <= p60 )
ans += int(s*0.9+0.5);
else
ans += s;
//printf("%.0lf\n",ans);
}
printf("%d\n",ans);
}
return 0;
}