#include <bits/stdc++.h>
using namespace std;
int N;
long long v[200002];
int main() {
  cin.sync_with_stdio(false);
  cin >> N;
  for (int i = 0; i < N; ++i) cin >> v[i];
  int ans = 0;
  long long diff = 0;
  long long start = 0;
  long long spos = -1;
  long long fixed = 0;
  long long fpos = 0;
  int nf = 0;
  for (long long i = 0; i < N; ++i) {
    if (spos == -1) {
      ++ans;
      diff = 0;
      start = v[i];
      spos = i;
      if (v[i] != -1) {
        fixed = v[i];
        fpos = i;
        nf = 1;
      } else {
        fixed = 0;
        fpos = 0;
        nf = 0;
      }
    } else if (nf >= 2) {
      if (v[i] == -1) {
        if (fixed + (i - fpos) * diff <= 0) {
          spos = -1;
          --i;
        }
      } else {
        if ((v[i] != fixed + (i - fpos) * diff)) {
          spos = -1;
          --i;
        }
      }
    } else if (v[i] != -1) {
      if (fixed == 0) {
        fixed = v[i];
        fpos = i;
        nf = 1;
      } else {
        diff = (v[i] - fixed) / (i - fpos);
        nf = 2;
        if ((v[i] - fixed) % (i - fpos) != 0) {
          spos = -1;
          --i;
        } else {
          if (start == -1) {
            if (v[i] - (i - spos) * diff <= 0) {
              spos = -1;
              --i;
            }
          } else {
            if (v[i] - (i - spos) * diff != start) {
              spos = -1;
              --i;
            }
          }
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}
