// editor4
#include<iostream>
#include<string>
#include<iomanip>
using namespace std;
int main()
{
    double temp;
    string unit;
    if(!(cin>>temp>>unit))
    return 0;
    cout<<fixed<<setprecision(2);
    if(unit =="Celsius")
    {
        cout<<temp*9.0/5.0)+32.0<<endl;
    }
    else if(unit == "Fahrenheit")
    {
        cout<<(temptemp-32.0)*5.0/9.0<<endl;
    }
    else
    {
        cout<<"Invalid input"<<endl;
    }
    return 0;
}