a=input() b=input() if len(a)>len(b): n=len(a) else: n=len(b) a=a.zfill(n) b=b.zfill(n) for i in range(len(a))[::-1]: if int(a[i])==1 and int(b[i])==1: print(0) exit() print(int('0b'+a,2)+int('0b'+b,2))