#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 2e9;
const long long LINF = 8e18;
int main() {
  ios_base::sync_with_stdio(0);
  long long n;
  cin >> n;
  for (int i = 1; i < n; i++) n -= i;
  cout << n << "\n";
  return 0;
}
