fruit = ['apple', 'banana', 'strawberry', 'orange', 'mango', 'grape', 'blueberry']
number = [1,3,5,6,13,21,10]
di = dict()
for i in range(len(fruit)):
di[fruit[i]] = number[i]
a = input()
try:
print(di[a])
except:
print(0)
fruit = ['apple', 'banana', 'strawberry', 'orange', 'mango', 'grape', 'blueberry']
number = [1,3,5,6,13,21,10]
di = dict()
for i in range(len(fruit)):
di[fruit[i]] = number[i]
a = input()
try:
print(di[a])
except:
print(0)