import math
a, b = input().split()
a = float(a)
p = 20
if  a > 1:
    p = p + math.ceil(a)-1
if b == 'y':
    p += 5
print(p)