#include <bits/stdc++.h>
using namespace std;
long long a[200005];
int nt[200005];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  memset(nt, -1, sizeof(nt));
  for (int i = n; i >= 1; i--) {
    if (a[i] != -1)
      nt[i] = i;
    else
      nt[i] = nt[i + 1];
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int l = nt[i], r;
    if (l == -1) {
      ans++;
      break;
    } else {
      r = nt[l + 1];
      if (r == -1) {
        ans++;
        break;
      } else {
        long long d1 = a[r] - a[l], d2 = r - l;
        if (d1 % d2 != 0) {
          ans++;
          i = r - 1;
        } else {
          ans++;
          long long d = d1 / d2;
          bool ok = 1;
          for (int j = l - 1; j >= i; j--) {
            a[j] = a[j + 1] - d;
            if (a[j] <= 0) {
              ok = 0;
              break;
            }
          }
          if (!ok) {
            i = r - 1;
          } else {
            ok = 1;
            for (int j = r + 1; j <= n; j++) {
              if (a[j] == -1) {
                a[j] = a[j - 1] + d;
                if (a[j] <= 0) {
                  i = j - 1;
                  a[j] = -1;
                  ok = 0;
                  break;
                }
              } else {
                if (a[j] != a[j - 1] + d) {
                  i = j - 1;
                  ok = 0;
                  break;
                }
              }
            }
            if (ok) break;
          }
        }
      }
    }
  }
  printf("%d\n", ans);
}
