#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int n, m, tot;
int s[211111];
void getone(int &now) {
  long long a = 0, b = 0;
  int l = 0, r = 0, mid = 0;
  while (now <= n) {
    if (a == 0 && s[now] == -1)
      l++;
    else if (a == 0 && s[now] > 0)
      a = s[now];
    else if (b == 0 && s[now] == -1)
      mid++;
    else if (b == 0 && s[now] > 0)
      b = s[now];
    if (b) break;
    now++;
  }
  if (now > n && (a == 0 || b == 0))
    tot++;
  else {
    if ((b - a) % (mid + 1) != 0)
      tot++;
    else {
      long long d = (b - a) / (mid + 1);
      if (a - l * d > 0) {
        tot++;
        while (b > 0 && (s[now] == b || s[now] == -1) && now <= n)
          b += d, now++;
      } else
        tot++;
    }
  }
}
int main() {
  int t, x, y, z, ca = 1;
  scanf("%d", &(n));
  for (int i = (int)(1); i <= (int)(n); ++i) scanf("%d", &(s[i]));
  int now = 1;
  while (now <= n) getone(now);
  printf("%d\n", (tot));
  return 0;
}
