#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int N = 200010;
int v[N];
int main(void) {
  int n, m;
  scanf("%d %d", &n, &m);
  int c = 0;
  set<pair<int, int> > s;
  int last = -1;
  for (int i = 0; i < n; i++) {
    scanf("%d", v + i);
    if (v[i] < 0) c++;
    if (v[i] < 0 and i and last != -1) {
      s.insert(make_pair(i - last - 1, i));
    }
    if (v[i] < 0) last = i;
  }
  if (c > m) {
    printf("-1\n");
    return 0;
  }
  if (!c) {
    cout << 0 << endl;
    return 0;
  }
  int sobra = m - c;
  while (!s.empty() and sobra > 0) {
    int tam = (*(s.begin())).first;
    int pos = (*(s.begin())).second;
    if (tam > sobra) break;
    sobra -= tam;
    for (int i = pos - tam; i < pos; i++) {
      v[i] = -10;
    }
    s.erase(s.begin());
  }
  s.insert(make_pair(n - last - 1, n));
  while (!s.empty() and sobra > 0) {
    int tam = (*(s.begin())).first;
    int pos = (*(s.begin())).second;
    if (tam > sobra) break;
    sobra -= tam;
    for (int i = pos - tam; i < pos; i++) {
      v[i] = -10;
    }
    s.erase(s.begin());
  }
  int flag = 0;
  c = 0;
  for (int i = 0; i < n; i++) {
    if (v[i] >= 0 and !flag) continue;
    if (v[i] < 0 and flag) continue;
    flag = 1 - flag;
    c++;
  }
  cout << c << endl;
  return 0;
}
