#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  int n, k;
  scanf("%d%d", &n, &k);
  vector<int> t(n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &t[i]);
    if (t[i] < 0) {
      k--;
    }
  }
  if (k < 0) {
    puts("-1");
    return 0;
  }
  int tot_gaps = 0;
  bool last = true;
  for (int i = 0; i < n; i++) {
    bool cur = true;
    if (t[i] < 0) {
      cur = false;
    }
    if (cur != last) {
      tot_gaps++;
      last = cur;
    }
  }
  int last_len = k + 1;
  priority_queue<pair<int, int> > q;
  int start = -1;
  for (int i = 0; i < n; i++) {
    if (t[i] < 0) {
      if (start != -1) {
        int e = i - 1;
        if (start != 0) {
          int seg_len = e - start + 1;
          q.push(make_pair(-seg_len, -e));
        }
        start = -1;
      }
    } else {
      if (start == -1) {
        start = i;
      }
    }
  }
  if (start != -1 && start != 0) {
    last_len = n - 1 - start + 1;
  }
  while (q.size()) {
    int cnt = -q.top().first;
    int e = -q.top().second;
    q.pop();
    k -= cnt;
    if (k < 0) {
      k += cnt;
      break;
    }
    tot_gaps -= 2;
  }
  if (k >= last_len) {
    tot_gaps--;
  }
  cout << tot_gaps << endl;
  return 0;
}
