#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MAXN = 200005;
int old[MAXN];
vector<int> V;
vector<pair<int, int> > goods;
int n;
int dp[1005][1005][2];
int solve(int pos, int left, int current) {
  if (pos == n) return 0;
  if (dp[pos][left][current] != -1) return dp[pos][left][current];
  int ans = (1 << 30);
  if (current) {
    if (left) ans = min(ans, solve(pos + 1, left - 1, current));
    if (V[pos] >= 0) ans = min(ans, solve(pos + 1, left, 0) + 1);
  } else {
    if (left) ans = min(ans, solve(pos + 1, left - 1, 1) + 1);
    if (V[pos] >= 0) {
      ans = min(ans, solve(pos + 1, left, current));
    }
  }
  return dp[pos][left][current] = ans;
}
int main() {
  srand(time(NULL));
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int k;
  cin >> n >> k;
  int negs = 0;
  for (int i = 0; i < n; i++) {
    cin >> old[i];
    if (old[i] < 0) negs++;
  }
  if (negs > k) {
    cout << -1 << endl;
    return 0;
  }
  int aux = 0;
  while (aux < n && old[aux] >= 0) {
    aux++;
  }
  if (aux == n) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = aux; i < n; i++) {
    V.push_back(old[i]);
  }
  n = V.size();
  int e;
  for (int i = 0; i < n; i = e) {
    if (V[i] >= 0) {
      e = i + 1;
      continue;
    }
    e = i;
    while (e < n && V[e] < 0) {
      e++;
    }
    goods.push_back(make_pair(i, e - 1));
  }
  priority_queue<int> Q;
  int ans = 1;
  ans += ((int)goods.size() - 1) * 2;
  if (goods.back().second != n - 1) ans++;
  for (int i = 1; i < goods.size(); i++) {
    int prev = goods[i - 1].second;
    int nxt = goods[i].first;
    int cost = nxt - prev - 1;
    Q.push(-cost);
  }
  int to_change = k - negs;
  while (!Q.empty()) {
    int x = -Q.top();
    Q.pop();
    if (to_change >= x) {
      to_change -= x;
      ans -= 2;
    }
  }
  while (!Q.empty()) Q.pop();
  if (goods.back().second != n - 1) Q.push(n - goods.back().second - 1);
  while (!Q.empty()) {
    int x = Q.top();
    Q.pop();
    if (to_change >= x) {
      to_change -= x;
      ans--;
    }
  }
  cout << ans << endl;
  return 0;
}
