#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, s = 0, i, p;
  cin >> n;
  i = 1;
  while (s < n) {
    s += i;
    i++;
  }
  i -= 2;
  p = s - n;
  cout << i - p + 1;
  return 0;
}
