#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const double eps = 1e-9;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long i, j, k, l, p, q, x, y, z, n, m, c(0), t, h;
  string s;
  cin >> s;
  long long sl = s.length();
  map<char, long long> mp;
  if (sl <= 1) {
    cout << 0;
    return 0;
  }
  for (i = 0; i < sl - 1; i++) {
    if (s[i] == 'V' && s[i + 1] == 'K') {
      c++;
      s[i] = '#';
      s[i + 1] = '#';
    }
    mp[s[i]]++;
    mp[s[i + 1]]++;
  }
  for (i = 0; i < sl - 1; i++) {
    if ((s[i] == 'V' && s[i + 1] == 'V') || (s[i] == 'K' && s[i + 1] == 'K')) {
      c++;
      break;
    }
  }
  cout << c;
}
