#include <bits/stdc++.h>
using namespace std;
int main() {
  char st[105];
  int vis[105] = {0};
  cin >> st;
  int l = strlen(st);
  int num = 0;
  for (int i = 0; i < l - 1; i++) {
    if (st[i] == 'V' && st[i + 1] == 'K') {
      num++;
      vis[i] = vis[i + 1] = 1;
    }
  }
  for (int i = 0; i < l - 1; i++) {
    if (vis[i] == 0 && vis[i + 1] == 0) {
      if (st[i] == 'V' || st[i + 1] == 'K') {
        num++;
        break;
      }
    }
  }
  cout << num << endl;
  return 0;
}
