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