#include <bits/stdc++.h>
using namespace std;
long long a[300041];
int main() {
  int n, ans = 0;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (long long i = 0; i < n;) {
    ans++;
    long long l = i;
    while (l < n && a[l] == -1) l++;
    if (l == n) break;
    long long r = l + 1;
    while (r < n && a[r] == -1) r++;
    if (r == n) break;
    long long dist = r - l;
    if ((a[r] - a[l]) % dist) {
      i = r;
      continue;
    }
    long long step = (a[r] - a[l]) / dist;
    if (step > 0 && a[l] - step * (l - i) <= 0) {
      i = r;
      continue;
    }
    long long rr = r + 1;
    while (a[r] + step * (rr - r) > 0 && rr < n &&
           (a[rr] == a[r] + step * (rr - r) || a[rr] == -1))
      rr++;
    i = rr;
  }
  cout << ans;
  return 0;
}
