#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
vector<long long> g[1000005];
vector<bool> vis(1000005, 0);
long long dx[] = {-1, 0, 1, 0};
long long dy[] = {0, -1, 0, 1};
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long x;
  cin >> x;
  if (x == 0) {
    cout << 0;
    return 0;
  } else {
    if (x < 0) x = -x;
    long long cnt = 0;
    long long len = 0;
    while (len < x || (len - x) & 1) {
      cnt++;
      len += cnt;
    }
    cout << cnt;
  }
}
