// editor3
#include<iostream>
#include<string>
#include<limits>
using namespace std;
int main(){
    int type;
    string d,p,r;
    double dist;
    cin>>type;
    cin.ignore();
    getline(cin, d);
    getline(cin, p);
    getline(cin, r);
    cin.ignore(numeric_limits<streamsize>::max(),'\n')
    cin>>dist;
    if(type==1)
        cout << dist*1.5;
    else if (type==2)
        cout << dist*0.8;
    else
        cout << "Invalid input" ;
    return 0;
    
}