#include <stdio.h>

int main() {
    char choice[20];
    double speed, convertedSpeed;
    
    scanf("%s", choice);
    scanf("%lf", &speed);
    
    if (speed < 0) {
        printf("Invalid input");
        return 0;
    }
    
    if (strcmp(choice, "KMH_TO_MPH") == 0) {
        convertedSpeed = speed * 0.621371;
        printf("%.2f", convertedSpeed);
    }
    else if (strcmp(choice, "MPH_TO_KMH") == 0) {
        convertedSpeed = speed * 1.60934;
        printf("%.2f", convertedSpeed);
    }
    else {
        printf("Invalid input")
    }
    
    return 0;
}