result = 0
first = input()
second = input()
if (first == "teal") and (second == "coral"):
    result = 7
elif (second == "teal") or (first == "indigo"):
    result = 9
# Added checking output; original plan stores only.
print(result)
