#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const double eps = 1e-8;
int t[200005];
int n, k;
vector<int> good;
vector<int> diff;
int main() {
  ios_base::sync_with_stdio(0);
  while (cin >> n >> k) {
    for (int i = 0; i < n; ++i) {
      cin >> t[i];
      if (t[i] < 0) {
        good.push_back(i);
      }
    }
    int cur = good.size();
    int time = cur << 1;
    if (cur > k)
      cout << "-1\n";
    else {
      for (int i = 0; i < cur - 1; ++i) {
        diff.push_back(good[i + 1] - good[i] - 1);
      }
      sort(diff.begin(), diff.end());
      for (int i = 0; i < diff.size(); ++i) {
        if (cur + diff[i] <= k) {
          time -= 2;
          cur += diff[i];
        } else
          break;
      }
      if (good.size() && (cur + n - good[good.size() - 1] - 1 <= k)) {
        time--;
      }
      cout << time << "\n";
    }
    good.clear();
    diff.clear();
  }
  return 0;
}
