#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const long long INFL = LLONG_MAX;
int N, A[200100], ans;
int solve(int index) {}
int main() {
  ios_base::sync_with_stdio(0);
  cout.precision(15);
  cin >> N;
  for (int(i) = 1; (i) <= (N); (i)++) cin >> A[i];
  {
    int index = 1;
    while (index <= N) {
      ans++;
      int original = index;
      while (index <= N && A[index] == -1) index++;
      if (index <= N) {
        int index2 = index + 1;
        while (index2 <= N && A[index2] == -1) index2++;
        if (index2 <= N) {
          if ((A[index2] - A[index]) % (index2 - index) == 0) {
            long long diff = (A[index2] - A[index]) / (index2 - index);
            if (-diff * (index - original) + A[index] <= 0) {
              index = index2;
              continue;
            }
            long long expected = A[index2];
            while (index2 <= N && (A[index2] == -1 || A[index2] == expected) &&
                   expected > 0) {
              expected += diff;
              index2++;
            }
          }
        }
        index = index2;
      }
    }
    cout << ans << '\n';
  }
}
