#include<iostream>
using namespace std;
class ShippingCost
{
    public:
    double calculate(double weight,double distance)
    {
        double rate;
        if(weight>0&&weight<1.0)
        rate=5.0;
        else if(weight>=1.0&&weight<5.0)
        rate=5.0
        else if(weight>=5.0&&weight<10.0)
        rate=20.0;
        else if(weight>=10.0)
        rate=50.0;
        else
        rate=0;
        return rate*distance*0.05;
    }
};
int main()
{
    double weight,distance;
    cin>>weight>>distance;
    if(weight<0||distance<0)
    {
        cout<<"Invalid input"<<endl;
        return 0;
    }
    ShippingCost sc;
    double cost=sc.calculate(weight,distance);
    if(cost==(int)cost)
    cout<<(int)cost<<endl;
    else
    cout<<cost<<endl;
    return 0;
}