#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
int binomial(int n, int k) {
  if (k == 0 || k == n) return 1;
  return binomial(n - 1, k - 1) + binomial(n - 1, k);
}
bool Sieve(long long int n) {
  bool prime[n + 100000];
  memset(prime, true, sizeof(prime));
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  return prime[n];
}
vector<long long> factor;
vector<long long> prime(long long n) {
  for (long long d = 2; d * d <= n; d++) {
    while (n % d == 0) {
      factor.push_back(d);
      n /= d;
    }
  }
  if (n > 1) factor.push_back(n);
  return factor;
}
pair<int, int> fib(int n) {
  if (n == 0) return {0, 1};
  auto p = fib(n >> 1);
  int c = p.first * (2 * p.second - p.first);
  int d = p.first * p.first + p.second * p.second;
  if (n & 1)
    return {d, c + d};
  else
    return {c, d};
}
int main() {
  int n;
  cin >> n;
  n = abs(n);
  int x = 0;
  int k = 0;
  int j = 0;
  while (x < n) {
    j++;
    x += j;
  }
  if ((x - n) % 2 != 0) {
    if (j % 2 != 0) {
      cout << j + 2 << endl;
    } else {
      cout << j + 1 << endl;
    }
  } else {
    cout << j << endl;
  }
}
