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