#include <bits/stdc++.h>
using namespace std;
int main() {
  int aa;
  int count = 1;
  int dd = 0;
  cin >> aa;
  if (aa < 0) aa = -aa;
  while (dd < aa) {
    dd += count;
    count++;
  }
  count--;
  if (dd == aa)
    cout << count << endl;
  else {
    int vv = dd - aa;
    if (vv % 2 == 0)
      cout << count << endl;
    else if ((count + 1) % 2) {
      cout << count + 1 << endl;
    } else
      cout << count + 2 << endl;
  }
  return 0;
}
