import math a, b = input().split() if b == 'y': c = 5 else: c = 0 if float(a) < 1: c += 20 else: c = c + 20 + math.ceil((float(a) - 1)) print(c)