N, *A = map(int, open(0).read().split()) print([1, 2][A[1] - A[0] == 1])