#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int t[n + 1];
  int i;
  int g = 0, flag[n + 1], flag2[n + 1];
  for (i = 1; i <= n; i++) {
    cin >> t[i];
    flag[i] = 1;
    if (t[i] < 0) g++;
  }
  if (g > k) {
    cout << -1;
    return 0;
  }
  int num = 0, num2 = 0;
  for (int i = 1; i <= n; i++) {
    if (t[i] < 0) {
      num++;
      flag[i] = 0;
      if (num == 1) continue;
      int k = 0;
      while (t[i - (++k)] >= 0)
        ;
      flag2[num2++] = k - 1;
    }
  }
  for (i = n; i >= 1; i--) {
    if (flag[i] == 0) break;
  }
  int ende = 0, endi = 0;
  if (i != n) flag2[num2++] = n - i, ende = 1, endi = n - i;
  if (!ende)
    sort(flag2, flag2 + num2);
  else
    sort(flag2, flag2 + num2 - 1);
  int m = k - num;
  int c2 = 0;
  if (ende == 0) {
    for (i = 0; i < num2; i++) {
      if ((m -= flag2[i]) >= 0) c2++;
      if (m <= 0) break;
    }
  } else {
    int c3 = 0, c4 = 0, m3 = m, m4 = m;
    for (i = 0; i < num2 - 1; i++) {
      if ((m3 -= flag2[i]) >= 0) c3++;
      if (m3 <= 0) break;
    }
    sort(flag2, flag2 + num2);
    for (i = 0; i < num2; i++) {
      if ((m4 -= flag2[i]) >= 0) c4++;
      if (m4 == 0) break;
      if (m4 < 0) {
        i--;
        break;
      }
    }
    if (c4 > c3) {
      c2 = c4;
      if (i == num2 || i + 1 == num2 || flag2[++i] > endi) ende = 0;
    } else
      c2 = c3;
  }
  if (num == 0) {
    cout << 0;
    return 0;
  } else if (num == n) {
    cout << 1;
    return 0;
  } else {
    cout << (num2 - c2) * 2 + 1 - ende;
  }
  return 0;
}
