#include <bits/stdc++.h>
using namespace std;
inline int read() {
  register char c = ' ';
  register int v = 0, x = 1;
  while ((c < '0') || (c > '9')) {
    if (c == '-') x = -1;
    c = getchar();
  }
  while ((c >= '0') && (c <= '9')) {
    v = (v << 1) + (v << 3) + (c ^ 48);
    c = getchar();
  }
  return v * x;
}
inline void write(register int x) {
  if (x < 0) x = -x, putchar('-');
  if (x > 9) write(x / 10);
  putchar(x % 10 ^ 48);
}
const int N = 200010;
int n, now = 1, ans;
long long a[N], d, x, y, p, q;
int main() {
  n = read();
  for (register int i = 1; i <= n; i++) a[i] = read();
  while (now <= n) {
    ans++, x = y = p = q = 0;
    while (now <= n && a[now] == -1) now++, x++;
    if (now == n + 1) break;
    p = a[now], now++;
    while (now <= n && a[now] == -1) now++, y++;
    if (now == n + 1) break;
    q = a[now];
    if ((q - p) % (y + 1)) continue;
    d = (q - p) / (y + 1);
    if (p <= d * x) continue;
    while (++now <= n) {
      if (a[now] == -1) {
        if (a[now - 1] + d <= 0) break;
        a[now] = a[now - 1] + d;
      } else if (a[now - 1] + d != a[now])
        break;
    }
  }
  write(ans);
  return ~~(0 - 0);
}
