#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long a[n + 1];
  for (int i = 1; i <= n; i++) cin >> a[i];
  int result = 0, k = 1;
  while (k <= n) {
    result++;
    int start = k;
    while (start <= n && a[start] == -1) start++;
    int end = start + 1;
    while (end <= n && a[end] == -1) end++;
    long long d = end - start;
    if ((a[end] - a[start]) % d != 0) {
      k = end;
      continue;
    }
    d = (a[end] - a[start]) / (end - start);
    if (a[start] - d * (start - k) <= 0) {
      k = end;
      continue;
    }
    int now = end + 1;
    while (now <= n) {
      long long num = a[start] + d * (now - start);
      if (num <= 0 || a[now] != -1 && a[now] != num) break;
      now++;
    }
    k = now;
  }
  cout << result << endl;
  return 0;
}
