#include <bits/stdc++.h>
using namespace std;
long long n, s[200007];
int main() {
  scanf("%I64d", &n);
  for (int i = 0; i < n; i++) scanf("%I64d", &s[i]);
  long long tests = 0, seg = 0, num1, num2, pos1, pos2, frnt = 0, betw = 0,
            delta;
  for (seg = 0; tests < n; seg++) {
    num1 = num2 = pos1 = pos2 = frnt = betw = 0;
    for (int i = tests; i < n; i++) {
      if (s[i] == -1 && !num1)
        frnt++;
      else if (s[i] == -1 && num1)
        betw++;
      if (s[i] != -1 && !num1)
        num1 = s[i], pos1 = i;
      else if (s[i] != -1 && num1) {
        num2 = s[i], pos2 = i;
        break;
      }
    }
    if (!num2) break;
    if ((num2 - num1) % (betw + 1)) {
      tests = pos2;
      continue;
    }
    delta = (num2 - num1) / (betw + 1);
    if (num1 - delta * frnt <= 0) {
      tests = pos2;
      continue;
    }
    for (long long j = tests, now = num1 - delta * frnt; j < n;
         j++, now += delta) {
      if (s[j] != -1)
        if (s[j] != now) {
          tests = j;
          break;
        }
      if (now <= 0) {
        tests = j;
        break;
      }
      s[j] = now;
      if (j == n - 1) tests = n;
    }
  }
  if (tests < n) seg++;
  printf("%d\n", seg);
  return 0;
}
