#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5;
long long line[maxn];
int sum, q1, q2;
int flag1, k, qw, wa, flag2;
int main() {
  int n, zz = 1;
  cin >> n;
  for (int i = (int)(1); i < (int)(n + 1); i++) cin >> line[i];
  while (zz <= n) {
    q1 = 0, q2 = 0, flag1 = 0, k = 0, wa = 0, flag2 = 0;
    sum++;
    for (int i = (int)(zz); i < (int)(n + 1); i++) {
      qw = i;
      if (line[i] != -1 && flag1 == 0) {
        q1 = line[i];
        flag1 = 1;
        continue;
      }
      if (flag1 == 1 && line[i] == -1) {
        k++;
        continue;
      }
      if (line[i] == -1 && flag1 == 0) {
        wa++;
        continue;
      }
      if (line[i] != -1 && flag1 == 1) {
        q2 = line[i];
        flag2 = 1;
        break;
      }
    }
    zz = qw;
    if (qw > n) break;
    if (qw == n && (flag2 == 0 || flag1 == 0)) break;
    if ((q2 - q1) % (k + 1) != 0) continue;
    long long d = (q2 - q1) / (k + 1);
    if (q1 - wa * d <= 0) continue;
    zz = qw + 1;
    while (zz <= n) {
      if (line[zz] == -1) {
        if (line[zz - 1] + d <= 0) break;
        line[zz] = line[zz - 1] + d;
        zz++;
      } else {
        if (line[zz] - line[zz - 1] != d) break;
        zz++;
      }
    }
  }
  cout << sum << endl;
  return 0;
}
