import math
a = input().split()
weight = float(a[0])
price = 0
emg = a[1]
if weight <= 1:
price = 20
if emg == 'y':
price = price +5
else:
price = math.ceil(weight)+19
if emg == 'y':
price = price +5
print(price)
import math
a = input().split()
weight = float(a[0])
price = 0
emg = a[1]
if weight <= 1:
price = 20
if emg == 'y':
price = price +5
else:
price = math.ceil(weight)+19
if emg == 'y':
price = price +5
print(price)