#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
istream &operator>>(istream &in, pair<T1, T2> &P) {
  in >> P.first >> P.second;
  return in;
}
template <class T1, class T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &P) {
  out << "(" << P.first << ", " << P.second << ")";
  return out;
}
template <class T>
istream &operator>>(istream &in, vector<T> &arr) {
  for (auto &x : arr) in >> x;
  return in;
}
template <class T>
ostream &operator<<(ostream &out, const vector<T> &arr) {
  for (auto &x : arr) out << x << ' ';
  cout << "\n";
  return out;
}
template <class T>
istream &operator>>(istream &in, deque<T> &arr) {
  for (auto &x : arr) in >> x;
  return in;
}
template <class T>
ostream &operator<<(ostream &out, const deque<T> &arr) {
  for (auto &x : arr) out << x << ' ';
  cout << "\n";
  return out;
}
int32_t main() {
  int n;
  cin >> n;
  vector<int> v(n);
  cin >> v;
  int l = 0;
  int ans = 0;
  while (l != n) {
    ans++;
    int last = -1;
    int r = l;
    while (r < n && (v[r] == -1 || last == -1)) {
      if (v[r] != -1) {
        last = r;
      }
      r++;
    }
    if ((r == n)) {
      l = r;
      break;
    }
    if (((v[r] - v[last]) % (r - last)) != 0) {
      l = r;
      continue;
    } else {
      long long u = (v[r] - v[last]) / (r - last);
      long long ff = v[last] - ((long long)last - l) * u;
      long long rr = l;
      bool can = true;
      while (rr < n) {
        long long p = ff + (rr - l) * u;
        if (p <= 0) {
          can = false;
          break;
        }
        if (v[rr] != -1) {
          if (p != v[rr]) {
            can = false;
            break;
          }
        }
        rr++;
      }
      r = max((long long)r, rr);
      l = r;
    }
  }
  cout << ans << endl;
}
