#include<bits/stdc++.h>
using namespace std;
int main(){
int h;
float q,p;
cin>>h>>q;
if (40>=h){
p=h*q;
}
else if (h<=50){
p=40*q+(h-40)*q*1.5;
}
else {
p=40*q+(h-40)*q*2.0;
}
printf("%.2f",p);
}
/**************************************************************
Problem: 1860
User: xiaojingxuan
Language: C++
Result: Wrong Answer
****************************************************************/