#include <bits/stdc++.h>
using namespace std;
struct doan {
  int x, d;
};
int m, n, k, num, kq, s;
doan b[100005], c[100005];
int a[100005];
bool cmp(doan t1, doan t2) { return t1.d < t2.d; }
void solve() {
  kq = k * 2 - 1;
  if (b[k].x + b[k].d <= n) kq++;
  int du = m - s;
  int i;
  for (i = 1; i < k; i++) {
    c[++num].x = b[i].x + b[i].d;
    c[num].d = b[i + 1].x - c[num].x;
  }
  sort(c + 1, c + num + 1, cmp);
  for (i = 1; i <= num; i++)
    if (du >= c[i].d) {
      du -= c[i].d;
      kq -= 2;
    } else
      break;
  if (b[k].x + b[k].d <= n && du >= n - (b[k].x + b[k].d) + 1) kq--;
  printf("%d", kq);
}
int main() {
  scanf("%d %d", &n, &m);
  int i;
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  i = 1;
  while (i <= n) {
    if (a[i] < 0) {
      b[++k].x = i;
      while (i <= n && a[i] < 0) {
        s++;
        b[k].d++;
        i++;
      }
    }
    i++;
  }
  if (s == 0)
    printf("0");
  else if (s > m)
    printf("-1");
  else
    solve();
  return 0;
}
