#include <stdio.h> int main() { float a,s,c; int b,m,d; scanf("%f %d %d %d",&a,&b,&m,&d); c=b==11?0.7:0.8; s=d==1?a*c-50:a*c; if(s<0) s=0.00; printf("%.2f",s); return 0; }