#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
long long pwr(long long base, long long p) {
  long long ans = 1;
  while (p) {
    if (p & 1) ans = (ans * base) % (1000000007LL);
    base = (base * base) % (1000000007LL);
    p >>= 1;
  }
  return ans;
}
long long modInv(long long n, long long mod) { return pwr(n, mod - 2); }
int bitCount(int n) {
  int c = 0;
  while (n) {
    c++;
    n &= n - 1;
  }
  return c;
}
long long arr[200005];
int main() {
  int i, n;
  cin >> n;
  for (i = 0; i < n; i++) cin >> arr[i];
  int ans = 0;
  i = 0;
  while (i < n) {
    ans++;
    int start, end;
    start = i;
    while (start < n && arr[start] == -1) start++;
    if (start == n) break;
    end = start + 1;
    while (end < n && arr[end] == -1) end++;
    if (end == n) break;
    if ((arr[end] - arr[start]) % (end - start) != 0) {
      i = end;
      continue;
    }
    long long d = (arr[end] - arr[start]) / (end - start);
    long long val_at_i = arr[start] - d * (start - i);
    if (val_at_i <= 0) {
      i = end;
      continue;
    }
    int r = end + 1;
    while (r < n) {
      long long expectedVal = arr[end] + (r - end) * d;
      if (arr[r] != -1 && arr[r] != expectedVal) break;
      if (expectedVal <= 0) break;
      r++;
    }
    i = r;
  }
  cout << ans;
  return 0;
}
