A = list(input()) B = list(input()) A.reverse() B.reverse() while len(A) < len(B): A.append(0) while len(B) < len(A): B.append(0) ans = 0 A.reverse() B.reverse() for i,j in zip(A,B): ans *= 2 ans += int(i) ^ int(j) print (ans)