#include <bits/stdc++.h>
using namespace std;
int n;
long long a[200005];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long l = 0;
  long long k = 0;
  while (l < n) {
    k++;
    long long ans = 0, cnt = 0, sum = 0;
    while (l < n && a[l] == -1) {
      ans++;
      l++;
    }
    if (l == n) break;
    cnt = a[l];
    l++;
    while (l < n && a[l] == -1) {
      sum++;
      l++;
    }
    if (l == n) break;
    long long kst = a[l];
    if ((kst - cnt) % (sum + 1) != 0) continue;
    long long d = (kst - cnt) / (sum + 1);
    if ((cnt - d * ans) <= 0) continue;
    l++;
    while (l < n) {
      if (a[l] == -1) {
        if ((a[l - 1] + d) <= 0)
          break;
        else
          a[l] = a[l - 1] + d;
        l++;
      } else {
        if (a[l] != a[l - 1] + d) break;
        l++;
      }
    }
  }
  cout << k;
  return 0;
}
