#include <bits/stdc++.h>
using namespace std;
void Emsawy() {}
int dx[]{1, -1, 0, 0, 1, -1, 1, -1};
int dy[]{0, 0, 1, -1, 1, -1, -1, 1};
long long suf(long long x) { return (x * (x + 1)) / 2; }
vector<vector<pair<int, int> > > adj;
const long long mod = 1e9 + 7, oo = 1e9;
int n, m, q;
int main() {
  Emsawy();
  while (cin >> n >> m) {
    vector<int> v(n);
    for (int i = 0; i < n; i++) scanf("%d", &v[i]);
    int ans = 0, st = 0, start = -1, end;
    for (int i = 0; i < n; i++) {
      if ((v[i] < 0) != (i == 0 ? 0 : (v[i - 1] < 0))) ans++;
      if (v[i] < 0) m--;
    }
    if (m < 0) {
      cout << -1 << endl;
      continue;
    }
    while (st < n && v[st] >= 0) st++;
    vector<int> rng;
    for (int i = st; i < v.size(); i++) {
      if (v[i] >= 0) {
        start = i;
        end = -1;
        for (int j = start; j < v.size(); j++, i++) {
          if (v[j] < 0) {
            end = j;
            i--;
            break;
          }
        }
        if (end != -1) rng.push_back(end - start);
      }
    }
    sort(((rng).begin()), ((rng).end()));
    for (int i = 0; i < rng.size(); i++) {
      if (rng[i] <= m) {
        ans -= 2;
        m -= rng[i];
      }
    }
    if (start != -1 && n - start <= m) ans--;
    cout << ans << endl;
  }
  return 0;
}
