#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(nullptr);     cout.tie(nullptr);     long long n, k;     cin >> n >> k;     long long l = 0;     long long r = n;     while (l != r) {       long long mid = (l + r) / 2;       if (mid * (mid + 1) / 2 - (n - mid) < k)         l = mid + 1;       else         r = mid;     }     cout << n - l;     return 0;   }   