#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, i, j, k, ans;
  long long int d;
  vector<long long int> v;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> j;
    v.push_back(j);
  }
  k = 0;
  ans = 0;
  while (k < n) {
    ans++;
    for (i = k; v[i] == -1; i++) {
    }
    for (j = i + 1; v[j] == -1; j++) {
    }
    if (j >= n) break;
    d = (v[j] - v[i]) / (j - i);
    if ((v[j] - v[i]) % (j - i) || v[j] - d * (j - k) <= 0) {
      k = j;
      continue;
    }
    k = j + 1;
    while (k < n && v[j] + d * (k - j) > 0 &&
           (v[k] == -1 || v[k] == (v[j] + d * (k - j))))
      k++;
  }
  cout << ans << endl;
  return 0;
}
