#include <bits/stdc++.h>
using namespace std;
const long long MAXX = 1e9 + 7;
void solve() {
  long long x;
  cin >> x;
  x = abs(x);
  long long res = 0;
  long long tot = 0;
  ;
  while (tot < x || (tot - x) % 2 != 0) {
    res++;
    tot += res;
  }
  cout << res << endl;
}
signed main() {
  solve();
  return 0;
}
