A = input() B = input() if len(A)>len(B): lon = A sho = B else: lon = B sho = A ans = 0 for i in range(0,len(sho)): ans += 2**i * ((int(lon[len(lon)-1-i])+int(sho[len(sho)-1-i]))%2) for j in range(len(sho),len(lon)): ans += 2**j * int(lon[len(lon)-1-j]) print(ans)