#include <bits/stdc++.h>
const int maxn = 200000 + 10;
using namespace std;
int a[maxn], b[maxn];
struct node {
  int x, y;
} s[maxn];
int main() {
  int n, m, i;
  scanf("%d%d", &n, &m);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  int k = 0, ans = 0;
  for (i = 0; i < n; i++) {
    if (a[i] < 0) k++;
    if (i) {
      if ((a[i] >= 0 && a[i - 1] < 0) || (a[i - 1] >= 0 && a[i] < 0)) ans++;
    } else if (a[0] < 0)
      ans++;
  }
  if (k == 0)
    printf("0\n");
  else if (k > m)
    printf("-1\n");
  else if (k == m)
    printf("%d\n", ans);
  else {
    k = m - k;
    int cnt = 0, t = 0;
    for (i = 0; i < n; i++) {
      if (a[i] < 0) {
        int j = i;
        while (a[j] < 0 && j < n) j++;
        s[cnt].x = i;
        s[cnt].y = j - 1;
        if (cnt) b[t++] = s[cnt].x - s[cnt - 1].y - 1;
        i = j - 1;
        cnt++;
      }
    }
    sort(b, b + t);
    for (i = 0; i < t; i++) {
      if (b[i] <= k) {
        k -= b[i];
        ans -= 2;
      } else
        break;
    }
    if (a[n - 1] >= 0) {
      b[t] = n - 1 - s[cnt - 1].y;
      if (b[t] <= k) ans -= 1;
    }
    printf("%d\n", ans);
  }
  return 0;
}
