s1=input().split()
s2=input()
print(s2 in s1)