#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[150];
  int i, j, k, l, s = 0, c = 0;
  cin >> a;
  l = strlen(a);
  for (i = 1; i < l; i++) {
    if (a[i] == 'K' && a[i - 1] == 'V') {
      c++;
      i++;
    } else if (a[i] == 'K' && a[i - 1] == 'K' && s == 0)
      c++, s = 1, i++;
    else if (a[i] == 'V' && a[i - 1] == 'V' && s == 0 && a[i + 1] != 'K')
      c++, s = 1, i++;
  }
  cout << c;
  return 0;
}
