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