#include<stdio.h>
int main()
{
    float t;
    char c;
    scanf("%f",&t);
    scanf("%c",&c);
    
    if(c=="C")
    {
        
    
        float cel = (t -32) *5/9;
        printf("%.2f",cel);
    }
    return 0;
}