#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x3f3f3f3f;
const long long LLINF = 0x3f3f3f3f3f3f3f3f;
const int MAX_N = (int)2e5 + 17;
int N, M, S, T, K, tp;
char mp[33][33];
long long ans[33][33];
string s;
int main() {
  while (cin >> s) {
    int ans = 0;
    int vis[111];
    memset(vis, 0, sizeof(vis));
    for (int i = 0; i < s.length() - 1; i++) {
      if (s[i] == 'V' && s[i + 1] == 'K') {
        vis[i] = vis[i + 1] = 1;
        ans++;
      }
    }
    for (int i = 0; i < s.length() - 1; i++) {
      if (!vis[i] && !vis[i + 1] && s[i] == s[i + 1]) {
        ans++;
        break;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
