#include <bits/stdc++.h>
using namespace std;
long long a[200005];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%I64d", &a[i]);
  int i, j, cnt = 0, last;
  i = 0;
  while (i < n) {
    last = i;
    while (i < n && a[i] == -1) i++;
    j = i + 1;
    while (j < n && a[j] == -1) j++;
    if (i < n && j < n) {
      if ((a[j] - a[i]) % (j - i) == 0) {
        int k = j + 1;
        long long tmp = (a[j] - a[i]) / (j - i);
        long long tmp1 = a[i] - (i - last) * tmp;
        if (tmp1 <= 0) {
          i = j;
        } else {
          tmp1 = a[j] + tmp;
          while (k < n && (a[k] == -1 || a[k] == tmp1) && tmp1 > 0) {
            k++;
            tmp1 += tmp;
          }
          i = k;
        }
      } else {
        i = j;
      }
    } else if (i < n) {
      i = j;
    }
    cnt++;
  }
  cout << cnt << endl;
}
