#include <bits/stdc++.h>
using namespace std;
int a[200000];
int calculate(int x, int y) {
  int pos1 = -1, pos2 = -1;
  for (int i = x; i <= y; i++) {
    if (a[i] != -1) {
      if (pos1 == -1)
        pos1 = i;
      else if (pos2 == -1)
        pos2 = i;
      else
        break;
    }
  }
  if (pos2 == -1) return 1;
  int dst = pos2 - pos1;
  int htd = a[pos2] - a[pos1];
  int abhtd = abs(htd);
  if (abhtd % dst != 0) return 1 + calculate(pos2, y);
  int diff = htd / dst;
  int j = pos1 - 1;
  long long exp = a[pos1] - diff;
  while (j >= x) {
    if (exp <= 0) break;
    exp -= diff;
    j--;
  }
  if (j != x - 1) return 1 + calculate(pos2, y);
  j = pos2 + 1, exp = a[pos2] + diff;
  while (j <= y) {
    if (exp <= 0) break;
    if (a[j] != exp && a[j] != -1) break;
    exp += diff;
    j++;
  }
  int offset = 0;
  if (j != y + 1) offset = calculate(j, y);
  return offset + 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  cout << calculate(0, n - 1) << endl;
  return 0;
}
