#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  while (~scanf("%d", &n)) {
    int ans = 0;
    int s = 0;
    while (1) {
      if (n < 0) n = -n;
      int temp = s * (s + 1) / 2 - n;
      s++;
      if (temp >= 0) {
        if (temp % 2 == 0) break;
      }
      ans++;
    }
    printf("%d\n", ans);
  }
  return 0;
}
