#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[110];
  int cnt = 0;
  cin >> s;
  for (int i = 0; s[i]; i++)
    if (s[i] == 'V' && s[i + 1] == 'K') {
      cnt++;
      s[i] = s[i + 1] = '0';
    }
  for (int i = 0; s[i]; i++)
    if ((s[i] == 'V' && s[i + 1] == 'V') || (s[i] == 'K' && s[i + 1] == 'K')) {
      cnt++;
      break;
    }
  cout << cnt << endl;
}
