#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  if (n < 0) n = -n;
  long long i;
  long long m = (long long)sqrt(2.0 * n);
  long long j = 0;
  if (m - 3 > 0) j = m - 3;
  for (i = j;; i++) {
    long long x = i * (i + 1) / 2;
    if (x >= n && (x - n) % 2 == 0) break;
  }
  cout << i << endl;
  return 0;
}
