#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int count = 0;
  int dp[1000];
  memset(dp, 0, sizeof(dp));
  for (int i = 0; i < s.size() - 1; i++) {
    if (s[i] == 'V' && s[i + 1] == 'K') {
      count++;
      dp[i] = 7;
      dp[i + 1] = 7;
      i = i + 1;
    } else if (s[i] == s[i + 1]) {
      dp[i] = 1;
      dp[i + 1] = 1;
    }
  }
  for (int i = 0; i < 1000; i++) {
    if (dp[i] == 1 && dp[i + 1] == 1) {
      cout << count + 1 << endl;
      return 0;
    }
  }
  cout << count << endl;
  return 0;
}
