import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main{
public static void main(String[] args) throws IOException{
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String[] str = bf.readLine().split(" ");
double weight = Double.parseDouble(str[0]);
char urgent = str[1].charAt(0);
double price = 0;
if(weight<=1){
if(urgent == 'y'){
price = 20 + 5;
}else{
price = 20;
}
}
if(weight >1){
if(urgent == 'y'){
price = 20 + Math.ceil(weight) - 1 + 5;
}else{
price = 20 + Math.ceil(weight) - 1;
}
}
System.out.print((int)price);
}
}
import java.io.IOException;
import java.io.InputStreamReader;
public class Main{
public static void main(String[] args) throws IOException{
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String[] str = bf.readLine().split(" ");
double weight = Double.parseDouble(str[0]);
char urgent = str[1].charAt(0);
double price = 0;
if(weight<=1){
if(urgent == 'y'){
price = 20 + 5;
}else{
price = 20;
}
}
if(weight >1){
if(urgent == 'y'){
price = 20 + Math.ceil(weight) - 1 + 5;
}else{
price = 20 + Math.ceil(weight) - 1;
}
}
System.out.print((int)price);
}
}