#include<iostream>
#include<iomanip>
#include<string>
using namespace std;
int main()
{
    double temp;
    string type;
    cin>> temp;
    cin>>type;
    try
    {
        double result;
        if(type == "Celcius")
        {
            result = (temp*9.0/5.0)+32.0;        }
    }
    else if(type == "Farenheit")
    {
        result = (temp-32.0)*5.0/9.0;
    }
    else
    {
        throw "Invalid";
    }
    cout<<fixed<<setprecision(2)<<reult;

catch(const char*)
{
    cout <<"Invalid input";
}
return 0;
}