# yukicoder No.863 計算量 2020/01/19 a=int(input()) b=int(input()) if a*40<=b<(a+1)*40: print(1) else: print(2)