#include<iostream>
using namespace std ;
class temp{
    public:
    void c2f(float t){
        float f;
        f =t*1.8+32;
        cout<<f;
    }
    void f2c(float t){
        float c;
        c =t-32*0.55;
        cout<<c;
    }
};
int main(){
    int num;
    temp a;
    int t ;
    cin>>t;
    if (t>=0){
        if (num == 1){
            a.c2f(t);
        }
        else if(num==2){
            a.f2c(t)
        }
    }
    else{
        cout<<"Invalid input";
    }
    
    
}