#include <bits/stdc++.h>
int a[300000];
int n;
void solve(int &i) {
  int j;
  for (j = i + 1; j < n && a[j] == -1; j++)
    ;
  int lmost;
  for (lmost = i - 1; lmost >= 0 && a[lmost] == -1; lmost--)
    ;
  lmost++;
  long long cha = (a[j] - a[i]) / (j - i);
  long long should;
  if ((a[j] - a[i]) % (j - i) != 0) {
    goto SAME;
  }
  should = a[i] - cha * (i - lmost);
  if (should <= 0) {
    goto SAME;
  }
  for (int k = lmost;; k++) {
    long long should = a[i] - cha * (i - k);
    if (should <= 0 || a[k] != -1 && should != a[k] || k >= n) {
      i = k - 1;
      return;
    } else if (a[k] == -1)
      a[k] = should;
  }
SAME:;
  for (int k = lmost; k < j; k++) {
    a[k] = a[i];
  }
  i = j - 1;
}
int main() {
  while (scanf("%d", &n) != EOF) {
    for (int i = 0; i < n; i++) {
      scanf("%d", &a[i]);
    }
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] != -1) {
        solve(i);
        cnt++;
      }
    }
    if (a[n - 1] == -1) cnt++;
    printf("%d\n", cnt);
  }
  return 0;
}
