#include <bits/stdc++.h>
using namespace std;
const int N = 220001;
long long a[N];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  int c = 0, l = 0;
  for (;;) {
    c++;
    int i = l;
    while (i < n && a[i] == -1) i++;
    if (i == n) break;
    int j = i + 1;
    while (j < n && a[j] == -1) j++;
    if (j == n) break;
    int r = (a[j] - a[i]) % (j - i);
    long long d = (a[j] - a[i]) / (j - i);
    if (r != 0 || a[i] + (l - i) * d < 1) {
      l = j;
      continue;
    }
    while (j < n) {
      j++;
      if (a[j - 1] + d < 1) break;
      if (a[j] == -1) a[j] = a[j - 1] + d;
      if (a[j] - a[j - 1] != d) break;
    }
    if (j == n) break;
    l = j;
  }
  cout << c << endl;
}
