n,k = map(int,input().split()) now = 1 count = 0 k = n*(n+1)//2-k for i in range(1,n+1): while now <= n and count < k: count += now now += 1 if count == k: print(1) exit() count -= i print(2)