#include <iostream>
#include<string>
#include<cmath>
#include<iomanip>
using namespace std;
int main(){
    string loantype;
    double amount;
    int years;
    cin>>loantype>>amount>>years;
    if((loantype!="home"&&loantype!="personal")|| amount<0 && amount<=100000){
        cout<<"Invalid input";
        return 0;
    }
    double interestRate;
    if(loantype=="home"){
        interestRate=5.0;
    }
    else if(loantype=="personal"){
        interestRate=10.0;
    }
    else{
        cout<<"Invalid input";
        return 0;
    }
    double interest=(amount*interestRate*year)/100.0;
    cout<<fixed<<setprecision(2)<<interest;
    return 0;
    
}