#include <bits/stdc++.h>
using namespace std;
int n, v[200005], ans1, ans2, neg, k, options[200005], nr_op;
inline int firstNegative() {
  for (int i = 1; i <= n; i++)
    if (v[i] < 0) return i;
  return n + 1;
}
inline int getCost(int energy) {
  if (energy < 0) return 1000000009;
  int cost = 2 * neg, index = 1;
  while (index <= nr_op && options[index] <= energy) {
    energy -= options[index];
    cost -= 2;
    index++;
  }
  return cost;
}
int main() {
  scanf("%d%d\n", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &v[i]);
    if (v[i] < 0) neg++;
  }
  if (neg > k) {
    printf("-1\n");
    return 0;
  }
  if (!neg) {
    printf("0\n");
    return 0;
  }
  int last = firstNegative();
  for (int i = last + 1; i <= n; i++) {
    if (v[i] >= 0) continue;
    options[++nr_op] = i - last - 1;
    last = i;
  }
  sort(options + 1, options + nr_op + 1);
  int special_option = n - last;
  int ans1 = getCost(k - neg);
  int ans2 = getCost(k - neg - special_option) - 1;
  printf("%d\n", min(ans1, ans2));
  return 0;
}
