#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long int count = 0, flag = 0, i, n;
  n = s.length();
  long long int a[n];
  memset(a, 0, sizeof(a));
  for (i = 0; i < n - 1; i++) {
    if (s[i] == 86 && s[i + 1] == 75) {
      count++;
      a[i] = 1;
      a[i + 1] = 1;
    }
  }
  for (i = 0; i < n - 1; i++) {
    if (a[i] == 0 && a[i + 1] == 0) {
      if (s[i] == s[i + 1]) {
        count++;
        break;
      }
    }
  }
  cout << count << "\n";
}
