A, B = gets.split.map(&:to_i) if 30.times.any?{|i| B[i] < A[i]} puts 0 else n = 32.times.count {|i| A[i] < B[i] } puts n > 0 ? 1 << (n - 1) : 1 end