#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
void fast() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
}
long long int power(long long int a, long long int b) {
  long long int ans = 1;
  while (b != 0) {
    if (b % 2 == 1) {
      ans *= a;
    }
    b /= 2;
    a *= a;
  }
  return ans;
}
long long int invmod(long long int a) { return pow(a, mod - 2); }
void print(int a[], int n) {
  for (int i = 0; i < n; i++) cout << a[i] << " ";
}
int main() {
  string s;
  cin >> s;
  int n = s.size(), ans = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'V' && s[i + 1] == 'K') ans++;
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == 'V' && s[i + 1] == 'V' && s[i + 2] != 'K' ||
        (s[i - 1] != 'V' && s[i] == 'K' && s[i + 1] == 'K')) {
      ans++;
      break;
    }
  }
  printf("%d\n", ans);
  return 0;
}
