a,b=input().split() if float(a)<=1 and b=="y": print(25) elif float(a)<=1 and b=="n": print(20) elif float(a)>1 and float(a)%1==0 and b=="y": print(int(20+(float(a)-1)*1+5)) elif float(a)>1 and float(a)%1==0 and b=="n": print(int(20 + (float(a) - 1) * 1)) elif float(a)>1 and float(a)%1!=0 and b=="y": print(int(20+(float(a)//1 - 1+1)*1+5)) else: print(int(20+(float(a)//1 - 1+1)*1))