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