#include <bits/stdc++.h>
using namespace std;
long long m, n, a, ans, ans1, t, k, sum, er[2000010], ar[300010], d,
    answ[400010], b, sum123[2][300010], sum321[2][300010], sum111[2][300010];
bool boo;
vector<pair<int, int> > seg;
bool compare(pair<int, int> a, pair<int, int> b) {
  if (a.first > b.first) return 1;
  if (a.first == b.first) {
    if (a.second > b.second) return 1;
    return 0;
  }
  return 0;
}
int main() {
  string s;
  std::ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  boo = 1;
  for (long long i = 0; i < n; i++) {
    cin >> ar[i];
    if (boo && ar[i] <= -1) {
      boo = 0;
      k -= 1;
      ans1++;
      continue;
    }
    if (ar[i] <= -1) {
      k -= 1;
      if (ans != 0) {
        ans1++;
        seg.push_back(make_pair(ans, seg.size() + 1));
        ans = 0;
      }
    }
    if (!boo && ar[i] >= 0) {
      if (ans == 0) {
        ans1++;
      }
      ans++;
    }
  }
  if (k < 0) {
    cout << -1;
    return 0;
  }
  if (boo == 1) {
    cout << 0;
    return 0;
  }
  if (seg.size() == 0 && ans == 0) {
    cout << 1;
    return 0;
  }
  sort(seg.begin(), seg.end(), compare);
  while (seg.size() > 0 && k - seg[seg.size() - 1].first >= 0) {
    k -= seg[seg.size() - 1].first;
    b = seg[seg.size() - 1].second;
    ans1 -= 2;
    seg.pop_back();
  }
  if (k >= ans && ans != 0) ans1--;
  cout << ans1;
}
