#include <bits/stdc++.h>
using namespace std;
int a[200005];
int n, ans = 0, i = 0;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  while (i < n) {
    ans++;
    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 d = (v2 - v1) / (p2 - p1);
    long long sum = v2 - (p2 - start) * d;
    if (sum <= 0) {
      i = p2;
      continue;
    }
    long long w = v2;
    while (i < n) {
      w += d;
      if (w <= 0) break;
      if (a[i] > 0 && a[i] != w) break;
      i++;
    }
  }
  printf("%d\n", ans);
  return 0;
}
