#include <bits/stdc++.h>
using namespace std;
char IN;
bool NEG;
inline void Int(int &x) {
  NEG = 0;
  while (!isdigit(IN = getchar()))
    if (IN == '-') NEG = 1;
  x = IN - '0';
  while (isdigit(IN = getchar())) x = x * 10 + IN - '0';
  if (NEG) x = -x;
}
inline void LL(long long &x) {
  NEG = 0;
  while (!isdigit(IN = getchar()))
    if (IN == '-') NEG = 1;
  x = IN - '0';
  while (isdigit(IN = getchar())) x = x * 10 + IN - '0';
  if (NEG) x = -x;
}
const int MAXN = 2e5 + 5;
const long long INF = 1e9;
long long a[MAXN];
int n;
bool ok(long long t) { return t > 0; }
int main() {
  int x;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    a[i] = x;
  }
  int sta = -1;
  int pre = 1;
  int ans = 0;
  int ret = 1;
  for (int i = 1; i <= n; i++) {
    if (a[i] != -1) {
      if (sta != -1) {
        int y = i;
        int x = sta;
        int step = y - x;
        long long d = a[y] - a[x];
        if (d % step == 0) {
          d /= step;
          long long res = a[y] - d * (y - pre);
          if (!ok(res)) {
            ans++;
            sta = i;
            pre = i;
            continue;
          }
          ans++;
          long long tmp = a[i];
          while (i <= n && (a[i] == -1 || a[i] == tmp) && ok(tmp)) {
            i++;
            pre = i;
            tmp += d;
          }
          if (i == n + 1) {
            ret = 0;
            break;
          }
          if (a[i] != -1)
            sta = i;
          else
            sta = -1;
        } else {
          ans++;
          pre = i;
          sta = i;
        }
      } else
        sta = i;
    }
  }
  if (ret > 0) ans++;
  cout << ans << endl;
  return 0;
}
