#include<iostream>
#include<string>
#include<iomanip>
using namespace std;
double calculateInterest(string loanType.double amount,int year){
    if(amount <-10000 || amount >1000000 || year<1 || year>30 ||(loanType !="home" && loanType!="personal"))
    {
        return -1;
    }
    double rate =(loanType == "home")? 0.05:0.10;
    return amount *rate *year;
}
int main(){
    stirng loanType;
    double amount;
    int year;
    cin>>loanType >>amount>>year;
    double intrest =calculateIntrest(loanType,amount year);
    if(intrest < 0){
        cout<<"Invlid input"<<endl;
    }else{
        cout<<fixed <<setprecision(2) <<intrest <<endl;
    }
    return 0;
}