#include<bits/stdc++.h>
using namespace std;
int main(){
    int h;
    float q,p=0.0;
    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+10*q*1.5+(h-50)*q*2.0;
	}
	printf("%.2f",p);
}
/**************************************************************
	Problem: 1860
	User: xiaojingxuan
	Language: C++
	Result: Accepted
	Time:44 ms
	Memory:2072 kb
****************************************************************/