#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 233;
const int inf = 2e9 + 10;
int f[maxn], a[maxn], pre[maxn];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) pre[i] = maxn;
  a[0] = a[n + 1] = -1;
  int k = n;
  while (k >= 1) {
    long long buf = inf;
    int start = k, first = -1;
    while ((buf == inf ||
            ((a[k] == -1 && a[first] + buf * (k - first) > 0) ||
             (a[k] != -1 && a[k] == a[first] + buf * (k - first)))) &&
           k) {
      if (a[k] != -1 && buf == inf) {
        if (first == -1)
          first = k;
        else {
          if ((a[first] - a[k]) % (first - k))
            break;
          else {
            buf = (a[first] - a[k]) / (first - k);
            long long laji = a[first] + buf * (start - first);
            if (laji <= 0) break;
          }
        }
      }
      k--;
    }
    for (int i = k + 1; i <= start; i++) pre[i] = min(pre[i], k + 1);
  }
  k = 1;
  while (k <= n) {
    long long buf = inf;
    int start = k, first = -1;
    while ((buf == inf ||
            ((a[k] == -1 && a[first] - buf * (first - k) > 0) ||
             (a[k] != -1 && a[k] == a[first] - buf * (first - k)))) &&
           k <= n) {
      if (a[k] != -1 && buf == inf) {
        if (first == -1)
          first = k;
        else {
          if ((a[k] - a[first]) % (k - first))
            break;
          else {
            buf = (a[k] - a[first]) / (k - first);
            long long laji = a[first] - buf * (first - start);
            if (laji <= 0) break;
          }
        }
      }
      k++;
    }
    for (int i = start; i < k; i++) pre[i] = min(pre[i], start);
  }
  f[0] = 0;
  for (int i = 1; i <= n; i++) f[i] = f[pre[i] - 1] + 1;
  cout << f[n] << endl;
  return 0;
}
