#include using namespace std; typedef long long ll; int main() { ll n, k; cin >> n >> k; k = n * (n + 1) / 2 - k; ll s = 0; ll t = n; for (ll i = 1; i <= n; i++) { s += i; if ((k - s) % i == 0 && k <= t) { cout << 1 << endl; return 0; } t += n - i; } cout << 2 << endl; }