#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T& x) {
  bool fu = 0;
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  if (c == '-') fu = 1, c = getchar();
  for (x = 0; c > 32; c = getchar()) x = x * 10 + c - '0';
  if (fu) x = -x;
};
template <class T>
inline void read(T& x, T& y) {
  read(x);
  read(y);
}
template <class T>
inline void read(T& x, T& y, T& z) {
  read(x);
  read(y);
  read(z);
}
inline char getc() {
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  return c;
}
const int N = 200010;
long long n, i, j, k, l, r, p, d, ans;
bool d0;
long long st, wei, la;
long long a[N];
int main() {
  read(n);
  for (i = 1; i <= n; i++) read(a[i]);
  wei = 1;
  d0 = 0;
  la = -1;
  ans = 1;
  for (i = 1; i <= n; i++) {
    if (a[i] > 0) {
      if (la == -1) {
        la = i;
      } else {
        bool pd1 = (a[i] - a[la]) % (i - la) == 0;
        long long dd = (a[i] - a[la]) / (i - la);
        if (pd1 && ((!d0) || dd == d)) {
          if (!d0) {
            d0 = 1;
            d = dd;
            st = a[i] - d * (i - wei);
            if (st <= 0) {
              ans++;
              wei = i;
              la = i;
              d0 = 0;
            }
          }
        } else {
          ans++;
          wei = i;
          la = i;
          d0 = 0;
        }
      }
    } else {
      if (d0) {
        if (st + d * (i - wei) <= 0) {
          ans++;
          wei = i;
          d0 = 0;
          la = -1;
        }
      }
    }
  }
  printf("%d\n", ans);
  scanf("\n");
  return 0;
}
