#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int x, m = 0, k = 0;
  cin >> x;
  x = abs(x);
  while (1) {
    if ((((k * (k + 1)) / 2) >= x) and ((((k * (k + 1)) / 2) - x) % 2 == 0)) {
      break;
    }
    k++;
  }
  cout << k;
}
