#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  long long int x;
  cin >> x;
  if (x < 0) x = -x;
  long long int sum = 0, step = 1;
  while (sum < x || (sum >= x && (sum - x) % 2)) {
    sum += step++;
  }
  cout << step - 1;
}
