#include <bits/stdc++.h>
using namespace std;
int main() {
  int w;
  scanf("%d", &w);
  if (w == 0) {
    printf("%d", 0);
    return 0;
  }
  long long n = abs(w);
  long long ans1 = 0;
  long long ans2 = 1;
  while ((ans1 - n) % 2 != 0 || ans1 - n < 0) {
    ans1 = ans1 + ans2;
    ans2++;
  }
  printf("%d", ans2 - 1);
  return 0;
}
