#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0;
  int x;
  cin >> x;
  x = abs(x);
  int i = 1;
  while (!(n >= x && (n % 2) == (x % 2))) {
    n += i;
    i++;
  }
  cout << i - 1 << endl;
}
