#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[200];
  while (cin >> s) {
    int len = strlen(s);
    int ans = 0, f = 1;
    for (int i = 1; i < len; i++) {
      if (s[i - 1] == 'V' && s[i] == 'K') {
        ans++;
        s[i - 1] = s[i] = 'q';
      }
    }
    for (int i = 1; i < len; i++) {
      if (s[i - 1] == s[i] && s[i] != 'q') {
        ans++;
        break;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
