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