#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int N = 200010;
ll a[N];
int n;
vector<pair<long long, int>> b;
int solve(int i) {
  vector<int> fix;
  int pos = i;
  ll beg = 0, r = 0;
  while (pos <= n) {
    if (a[pos] == -1) {
      if (beg > 0 and beg + r * (pos - fix[0]) <= 0) return 1 + solve(pos);
    } else {
      if (fix.empty())
        fix.push_back(pos);
      else if (fix.size() == 1) {
        if ((a[pos] - a[fix[0]]) % (pos - fix[0])) return 1 + solve(pos);
        beg = a[fix[0]];
        r = (a[pos] - a[fix[0]]) / (pos - fix[0]);
        if (fix[0] != i and beg - r * (fix[0] - i) <= 0) return 1 + solve(pos);
        fix.push_back(pos);
      } else {
        if (a[pos] != beg + r * (pos - fix[0])) return 1 + solve(pos);
      }
    }
    pos++;
  }
  return 1;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", a + i);
  }
  int ans = solve(1);
  printf("%d\n", ans);
  return 0;
}
