#include <bits/stdc++.h>
using namespace std;
const int inf = 1e5;
int main(void) {
  ios_base::sync_with_stdio(false);
  long long x, sum;
  cin >> x;
  bool odd = false;
  if (x % 2 != 0) {
    odd = true;
  }
  for (long long i = 0;; i++) {
    sum = i * (i + 1) / 2;
    if ((sum % 2 != 0) == odd)
      if (abs(x) <= sum) {
        cout << i;
        break;
      }
  }
}
