#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b;
  cin >> n;
  a = 0;
  b = 0;
  n = abs(n);
  while ((a - n) % 2 != 0 || a - n < 0) {
    b = b + 1;
    a = a + b;
  }
  cout << b;
  return 0;
}
