name_list = input().split()
name = input()

print(name in name_list)