#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, d;
  while (scanf("%d", &n) != EOF) {
    if (n < 0) n = -n;
    int now = 0, num = 1;
    int ans = 0;
    while (now < n || (now - n) % 2) {
      ans++;
      now += num;
      num++;
    }
    printf("%d\n", ans);
  }
  return 0;
}
