#include int main () { long long n = 0LL; long long k = 0LL; int res = 0; long long tmp = 0LL; res = scanf("%lld", &n); res = scanf("%lld", &k); k = (n*(n+1LL))/2LL-k; tmp = n; while (tmp > 0LL) { long long sum = (tmp*(tmp+1LL))/2LL; if (sum >= k) { long long lr[2] = { 0LL, tmp }; while (lr[1] - lr[0] > 1LL) { long long nxt = (lr[0]+lr[1])/2LL; if ((nxt*(nxt+1LL))/2LL <= sum-k) { lr[0] = nxt; } else { lr[1] = nxt; } } if ((lr[0]*(lr[0]+1LL))/2LL == sum-k) { printf("1\n"); return 0; } } tmp -= 1LL; } printf("2\n"); return 0; }