a = int(input())
b = int(input())
c = a & b
print(2 * c)