#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 2e5 + 100;
const long long INF = 1e18 + 100;
long long n;
long long mas[MAXN];
long long get(long long ll) {
  long long l = ll;
  pair<long long, long long> p = {-1, -1};
  long long d = INF;
  while (l < n) {
    if (mas[l] == -1) {
      if ((p != make_pair(-1LL, -1LL)) && (d != INF)) {
        if (p.first + (l - p.second) * d > 0) {
          l++;
        } else {
          return l;
        }
      } else {
        l++;
      }
    } else {
      if (p == make_pair(-1LL, -1LL)) {
        p = {mas[l], l};
        l++;
      } else if (d == INF) {
        if ((mas[l] - p.first) % (l - p.second) != 0) {
          return l;
        } else {
          d = (mas[l] - p.first) / (l - p.second);
          if (p.first - (p.second - ll) * d > 0) {
            l++;
          } else {
            return l;
          }
        }
      } else {
        if (mas[l] == p.first + (l - p.second) * d) {
          l++;
        } else {
          return l;
        }
      }
    }
  }
  return l;
}
int main() {
  ios::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  cin >> n;
  for (long long i = 0; i < n; ++i) {
    cin >> mas[i];
  }
  long long l = 0;
  long long ans = 0;
  while (l < n) {
    l = get(l);
    ans++;
  }
  cout << ans << endl;
  return 0;
}
