#include <bits/stdc++.h>
int main() {
  int n;
  while (~scanf("%d", &n)) {
    int sum = 0;
    if (n < 0) n = -n;
    for (int i = 0;; i++) {
      sum += i;
      if (sum >= n && (sum - n) % 2 == 0) {
        printf("%d\n", i);
        break;
      }
    }
  }
  return 0;
}
