#include <bits/stdc++.h>
using namespace std;
const int nmax = 200005;
int n;
long long a[nmax];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  int ans = 0;
  for (int i = 1; i <= n; ans++, i++) {
    int j, k;
    for (j = i; j <= n && a[j] == -1; j++)
      ;
    if (j == n + 1) {
      i = j;
      continue;
    }
    for (k = j + 1; k <= n && a[k] == -1; k++)
      ;
    if (k == n + 1) {
      i = k;
      continue;
    }
    int r = ((a[k] - a[j]) / (k - j));
    if (((a[k] - a[j]) % (k - j)) != 0 ||
        (r > 0 && (1LL * a[k] - 1LL * r * (k - i)) <= 0)) {
      i = k - 1;
      continue;
    }
    for (; k <= n; k++) {
      long long v = 1LL * a[j] + 1LL * r * (k - j);
      if (a[k] != -1 && a[k] != v) break;
      if (v <= 0) break;
    }
    i = k - 1;
  }
  printf("%d\n", ans);
  return 0;
}
