#include<iostream>
#include<iomanip>
using namespace std;

int main(){
    double temp;
    string type;
    
     cin >> temp >>type;
     
     if(type == "Celsius") {
         double f =(temp * 9.0/5.0) + 32;
         
         cout<< fixed << steprecision(2) << f;
     }
     else if(type =="Fahrenheit"){
         double c = (temp -32) * 5.0/9.0;
         cout << fixed << setprecision(2) << c;
     }
     else{
         cout << "Invlaid input";
     }
     return 0;
}