#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
const int INF = 2147483647;
const long long LINF = 9223372036854775807;
const int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1};
string s;
int ans = 0;
bool ok = 0;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> s;
  for (int(i) = 0; i < (s.size() - 1); i++) {
    if (s[i] == 'V' && s[i + 1] == 'K') {
      ans++;
      i++;
    } else if (s[i] == 'V') {
      if (s[i + 1] == 'V' && i + 2 < s.size() && s[i + 2] == 'K') continue;
      ok = 1;
      i++;
    } else if (s[i + 1] == 'K')
      ok = 1;
  }
  cout << ans + ok << endl;
  return 0;
}
