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