#include<iostream>
#include<iomanip>
using namespace std;
int main(){
    string loanType;
    double amount;
    int year;
    cin >> loanType >>amount >> years;
    if ((loanType !="home" && loanType !="personasl")||
    amount < 1 || amount >1000000 ||
    years < 1 || years >30){
        cout <<"Invalid input" <<endl;
        return 0;
}
double rate;
if (loanType =="home")
   rate = 0.05;
else
   rate = 0.10;
   double interest = amount * rate *years;
   cout<<fixed << setprecision(2) <<
   interest << endl; 
   return 0;
}