#include <bits/stdc++.h>
using namespace std;
bool comp(pair<int, int> &p1, pair<int, int> &p2) {
  return p1.first < p2.first;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, k, ans = 0, indi_count = 0, gap_count = 0, num_neg = 0;
  cin >> n >> k;
  int days[n];
  vector<int> summers;
  vector<pair<int, int> > gaps;
  for (int i = 0; i < n; i++)
    cin >> days[i], days[i] < 0 ? num_neg++, ans += 2 : 1;
  if (k < num_neg) cout << -1 << endl, exit(0);
  for (int i = 0; i < n; i++) {
    if (days[i] < 0) summers.push_back(i);
  }
  int size = (int)summers.size();
  for (int i = 0; i < size - 1; i++)
    gaps.push_back(make_pair(summers[i + 1] - summers[i] - 1, summers[i]));
  std::sort(gaps.begin(), gaps.end(), comp);
  k -= num_neg;
  int size_ = (int)gaps.size();
  for (int i = 0; i < size_; i++) {
    if (gaps[i].first < 0) continue;
    if (k >= gaps[i].first) {
      k -= gaps[i].first;
      ans -= 2;
    } else
      break;
  }
  if (size >= 1 && k >= n - summers[size - 1] - 1) ans--;
  cout << ans << endl;
  return 0;
}
