#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 (40>h && h<=50){
		p=39*q+(h-40)*q*1.5;
	}
	else {
		p=39*q+(h-40)*q*2.0;
	}
	printf("%.2f",p);
}
/**************************************************************
	Problem: 1860
	User: xiaojingxuan
	Language: C++
	Result: Wrong Answer
****************************************************************/