#include <bits/stdc++.h>
using namespace std;
long long sequence[200000 + 1];
int main() {
  int n, first = -1, sec = -1, iter, begseq = -1, count = 0;
  long long delta = 100000000;
  bool seqnotfinished = false;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> sequence[i];
  iter = 1;
  while (iter <= n) {
    if (sequence[iter] == -1 && begseq == -1)
      begseq = iter;
    else {
      if (sequence[iter] != -1 && first == -1)
        first = iter;
      else if (sequence[iter] != -1) {
        if (delta == 100000000) {
          if (abs(sequence[iter] - sequence[first]) % (iter - first) != 0) {
            begseq = -1;
            first = iter;
            ++count;
            ++iter;
            continue;
          } else {
            delta = (sequence[iter] - sequence[first]) / (iter - first);
            if (begseq < first && begseq != -1) {
              if (sequence[first] - delta * (first - begseq) < 1) {
                begseq = -1;
                first = iter;
                delta = 100000000;
                ++count;
                ++iter;
                continue;
              }
            }
            begseq = -1;
            first = iter;
            ++iter;
            continue;
          }
        } else {
          if (sequence[first] + delta * (iter - first) == sequence[iter]) {
            begseq = -1;
            first = iter;
            ++iter;
            continue;
          } else if (delta > 0) {
            begseq = -1;
            first = iter;
            ++count;
            delta = 100000000;
            ++iter;
            continue;
          } else {
            if (delta != 0)
              begseq = first + (sequence[first] - 1) / abs(delta);
            else
              begseq = -1;
            if (begseq >= iter) begseq = -1;
            if (begseq != -1) {
              begseq++;
              if (begseq == iter) begseq = -1;
            }
            first = iter;
            ++count;
            delta = 100000000;
            ++iter;
            continue;
          }
        }
      }
    }
    ++iter;
  }
  if (first <= n) {
    if (delta == 100000000 || first == n)
      ++count;
    else if (sequence[first] + (iter - first - 1) * delta < 1)
      count += 2;
    else
      ++count;
  }
  cout << count;
  return 0;
}
