#include <bits/stdc++.h>
using namespace std;
long long n, a[200005], ans;
signed main() {
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long i = 0;
  while (i < n) {
    ans++;
    long long i1 = 0, i2 = 0, val1 = 0, val2 = 0;
    while (i < n && a[i] == -1) {
      i1++;
      i++;
    }
    if (i == n) break;
    val1 = a[i];
    i++;
    while (i < n && a[i] == -1) {
      i2++;
      i++;
    }
    if (i == n) break;
    val2 = a[i];
    if ((val2 - val1) % (i2 + 1) != 0) continue;
    long long c = (val2 - val1) / (i2 + 1);
    if (val1 - i1 * c <= 0) continue;
    i++;
    while (i < n) {
      if (a[i] == -1) {
        if (a[i - 1] + c <= 0) break;
        a[i] = a[i - 1] + c;
        i++;
      } else {
        if (a[i] != a[i - 1] + c) break;
        i++;
      }
    }
  }
  cout << ans;
  return 0;
}
