def XNOR(a,b): if(a == b): return 1 else: return 0 x = input() y = input() print(XNOR(x,y))