#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int a[N], len[N], tot;
int main() {
  int n, K, sum = 0, la = -1;
  scanf("%d%d", &n, &K);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] < 0) {
      K--, sum += 2;
      if (~la) len[++tot] = i - la - 1;
      la = i;
    }
  }
  if (K < 0) {
    cout << -1;
    return 0;
  }
  sort(len + 1, len + tot + 1);
  for (int i = 1; i <= tot; i++) {
    if (K >= len[i])
      K -= len[i], sum -= 2;
    else
      break;
  }
  if (K >= n - la)
    cout << sum - 1;
  else
    cout << sum;
  return 0;
}
