Gx = input() Gy = input() if abs(Gx) == abs(Gy): print('1') else: print('2')