#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  int res = 0;
  int i = 0;
  while (i < n) {
    res++;
    vector<long long> p;
    long long start = i;
    while (i < n && p.size() < 2) {
      if (a[i] > 0) p.push_back(i);
      i++;
    }
    if (p.size() < 2) break;
    long long p1 = p[0];
    long long p2 = p[1];
    long long v1 = a[p1];
    long long v2 = a[p2];
    if ((v2 - v1) % (p2 - p1)) {
      i = p2;
      continue;
    }
    long long delta = (v2 - v1) / (p2 - p1);
    long long startV = v2 - (p2 - start) * delta;
    if (startV <= 0) {
      i = p2;
      continue;
    }
    long long want = v2;
    while (i < n) {
      want += delta;
      if (want <= 0) break;
      if (a[i] > 0 && a[i] != want) break;
      i++;
    }
  }
  cout << res;
  return 0;
}
