#include <bits/stdc++.h>
using namespace std;
int n;
int a[222222];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  int ret = 0, at = 0;
  while (at < n) {
    int to = at;
    int p = -1;
    int q = -1;
    long long dy = 0;
    bool running = false;
    for (; to < n; to++) {
      if (a[to] == -1) {
        if (p != -1 && q != -1 && a[p] + (to - p) * dy <= 0) break;
        if (!running) {
          running = true;
          ret++;
        }
        continue;
      }
      if (p == -1) {
        p = to;
        if (!running) {
          running = true;
          ret++;
        }
        continue;
      }
      if (q == -1) {
        q = to;
        if ((a[q] - a[p]) % (q - p) != 0) break;
        dy = (a[q] - a[p]) / (q - p);
        if (a[p] + (at - p) * dy <= 0) break;
        if (!running) {
          running = true;
          ret++;
        }
        continue;
      }
      if (a[p] + (to - p) * dy != a[to]) break;
      if (!running) {
        running = true;
        ret++;
      }
      continue;
    }
    at = to;
  }
  cout << ret << endl;
  return 0;
}
