A = int(input()) B = int(input()) # Check for linear time complexity (P*N) linear_low = max(A / 5000, B / 200000) linear_high = min((A + 1) / 5000, (B + 1) / 200000) linear_possible = linear_low < linear_high # Check for quadratic time complexity (Q*N^2) square_low = max(A / (25_000_000), B / (400_000_000_000)) square_high = min((A + 1) / 25_000_000, (B + 1) / 400_000_000_000) square_possible = square_low < square_high print(1 if linear_possible else 2)