#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > tt;
vector<int> pos, neg;
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  int a[n + 10];
  int negn = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (a[i] < 0) negn++;
    if (a[i] < 0)
      a[i] = -1;
    else
      a[i] = 1;
  }
  if (negn > k) {
    cout << -1;
    return 0;
  }
  int prev = 1;
  int cnt = 1;
  for (int i = 0; i < n; i++) {
    if (a[i] == prev)
      cnt++;
    else {
      if (prev == 1)
        pos.push_back(cnt);
      else
        neg.push_back(cnt);
      cnt = 1;
      prev = a[i];
    }
  }
  if (prev == 1)
    pos.push_back(cnt);
  else
    neg.push_back(cnt);
  int ans = 2 * neg.size();
  if (a[n - 1] == -1) ans--;
  int rem = k - negn;
  pos.erase(pos.begin());
  if (neg.size() == 0) {
    cout << "0";
    return 0;
  }
  if (pos.size() == 0) {
    cout << "1";
    return 0;
  }
  for (int i = 0; i < pos.size(); i++) {
    if (i == pos.size() - 1 && a[n - 1] == 1)
      tt.push_back(pair<int, int>(pos[i], 1));
    else
      tt.push_back(pair<int, int>(pos[i], 0));
  }
  int mx = 0;
  if (tt[tt.size() - 1].second != 1) {
    sort(tt.begin(), tt.end());
    for (int i = 0; i < tt.size(); i++) {
      if (rem < tt[i].first) break;
      rem -= tt[i].first;
      mx += 2;
    }
  } else {
    int asdf = tt[tt.size() - 1].first;
    tt.pop_back();
    sort(tt.begin(), tt.end());
    int rem = k - negn;
    for (int i = 0; i < tt.size(); i++) {
      if (rem < tt[i].first) break;
      rem -= tt[i].first;
      mx += 2;
    }
    int mx1 = 1;
    rem = k - negn - asdf;
    for (int i = 0; i < tt.size(); i++) {
      if (rem < tt[i].first) break;
      rem -= tt[i].first;
      mx1 += 2;
    }
    if (rem >= 0) mx = max(mx, mx1);
  }
  ans -= mx;
  cout << ans << endl;
}
