#include <bits/stdc++.h>
long long i, k, ps, c, kt, d;
int n, m;
bool bs, bp, bt;
int main() {
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%I64d", &c);
    if (~c) {
      if (bp) {
        if (d * (i - k) + ps != c) {
          ++m;
          bp = 0;
          bs = 1;
          bt = 0;
          k = i;
          ps = c;
        }
      } else {
        if (bs) {
          if ((c - ps) % (i - k) == 0) {
            bp = 1;
            d = (c - ps) / (i - k);
            if (bt) {
              if (ps - d * (k - kt) < 1) {
                ++m;
                bp = 0;
                bs = 1;
                k = i;
                ps = c;
              }
              bt = 0;
            }
          } else {
            ++m;
            bs = 1;
            k = i;
            ps = c;
            bt = 0;
          }
        } else {
          ++m;
          bs = 1;
          k = i;
          ps = c;
        }
      }
    } else {
      if (bp) {
        if (d * (i - k) + ps < 1) {
          bp = 0;
          bs = 0;
          bt = 1;
          kt = i;
        }
      } else {
        if (!bt && !bs) {
          bt = 1;
          kt = i;
        }
      }
    }
  }
  if (bt && !bs) ++m;
  printf("%d\n", m);
  return 0;
}
