#include <bits/stdc++.h>
using namespace std;
template <typename T>
void out(T x) {
  cout << x << endl;
  exit(0);
}
template <typename T>
void trace(T *a, int s, int n) {
  for (int i = s; i < n; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
}
const long long mod = 1e9 + 7;
const int maxn = 1e6 + 5;
int n;
long long a[maxn];
int ans;
const int NO = 2e9;
int last = NO;
long long curd = NO;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n;) {
    ans++;
    int l = i;
    while (l < n && a[l] == -1) l++;
    if (l == n) break;
    int r = l + 1;
    while (r < n && a[r] == -1) r++;
    if (r == n) break;
    if ((a[r] - a[l]) % (r - l)) {
      i = r;
      continue;
    }
    long long gap = (a[r] - a[l]) / (r - l);
    long long first = a[r] - gap * (r - i);
    if (first <= 0) {
      i = r;
      continue;
    }
    while (r < n) {
      long long need = a[l] + gap * (r - l);
      if (need <= 0) break;
      if (a[r] != -1 && a[r] != need) {
        break;
      }
      r++;
    }
    i = r;
  }
  cout << ans << endl;
  return 0;
}
