#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int ans = 0;
  for (int i = 0; i < s.size() - 1; i++)
    if (s[i] == 'V' and s[i + 1] == 'K') {
      ans++;
      s[i]--;
      s[i + 1]--;
      i++;
    }
  for (int i = 0; i < s.size() - 1; i++)
    if (s[i] == s[i + 1]) {
      ans++;
      break;
    }
  cout << ans;
  return 0;
}
