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