import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
float a = scanner.nextFloat(); // 重量
char b = scanner.next().charAt(0);// 是否加急 'y' or 'n'
if(b == 'y') {
if(a > 1 && a % 1 != 0) {
System.out.println(20 + (int)(a - 1) + 6);
//25是超过的一千克但是小于一千克的部分在加5得来的
} else if(a > 1 && a % 1 == 0) {
System.out.println(20 + (int)(a - 1) + 5);
} else if(a < 1) {
System.out.println(25);
}
} else if(b == 'n') {
if(a > 1 && a % 1 != 0) {
System.out.println(20 + (int)(a - 1) + 1);
} else if(a > 1 && a % 1 == 0) {
System.out.println(20 + (int)(a - 1));
} else if(a < 1) {
System.out.println(20);
}
}
}
}