#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 9, mod = 1e9 + 7, inf = 1e18;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  n = abs(n);
  long long sum = 0;
  for (long long i = (n == 0) ? 0 : 1;; i++) {
    sum += i;
    if (sum < n) continue;
    if ((sum - n) & 1) continue;
    cout << i << "\n";
    break;
  }
}
