#include <bits/stdc++.h>
using namespace std;
long int i, x, sum, ans = 0;
int main() {
  cin >> x;
  x = abs(x);
  while (sum < x || (sum - x) % 2 == 1) {
    ans++;
    sum += ans;
  }
  cout << ans;
  return 0;
}
