#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int maxn = 250050;
long long a[maxn];
int n;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  int ans = 0;
  int it = 0;
  while (it < n) {
    ans++;
    int pr = 0;
    int suf = 0;
    int val = 0;
    while (it < n && a[it] == -1) {
      pr++;
      it++;
    }
    if (it == n) break;
    val = a[it];
    it++;
    while (it < n && a[it] == -1) {
      suf++;
      it++;
    }
    if (it == n) break;
    int val1 = a[it];
    if ((val1 - val) % (suf + 1) != 0) continue;
    long long d = (val1 - val) / (suf + 1);
    if (val - pr * d <= 0) continue;
    it++;
    while (it < n) {
      if (a[it] == -1) {
        if (a[it - 1] + d <= 0) break;
        a[it] = a[it - 1] + d;
        it++;
      } else {
        if (a[it] != a[it - 1] + d) break;
        it++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
