A=int(input()) B=int(input()) DL=abs(A/5000 - B/200000) DQ=abs(A/(5000**2) - B/(200000**2)) print(1 if DL < DQ else 2)