Tonio has a keyboard with only two letters, "V" and "K".One day, he has typed out a string s with only these two letters. He really likes it when the string "VK" appears, so he wishes to change at most one letter in the string (or do no changes) to maximize the number of occurrences of that string. Compute the maximum number of times "VK" can appear as a substring (i. e. a letter "K" right after a letter "V") in the resulting string.

The first line will contain a string s consisting only of uppercase English letters "V" and "K" with length not less than 1 and not greater than 100.

Output a single integer, the maximum number of times "VK" can appear as a substring of the given string after changing at most one character.

NoteFor the first case, we do not change any letters. "VK" appears once, which is the maximum number of times it could appear.For the second case, we can change the second character from a "V" to a "K". This will give us the string "VK". This has one occurrence of the string "VK" as a substring.For the fourth case, we can change the fourth character from a "K" to a "V". This will give us the string "VKKVKKKKKKVVVVVVVVVK". This has three occurrences of the string "VK" as a substring. We can check no other moves can give us strictly more occurrences.

import java.io.*;
import java.util.StringTokenizer;

public class Main {

	public static FastScanner in = new FastScanner(System.in);
	public static PrintWriter pw = new PrintWriter(System.out);

	public static class FastScanner {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public FastScanner(InputStream i) {
			reader = new BufferedReader(new InputStreamReader(i));
			tokenizer = new StringTokenizer("");
		}

		public String next() throws IOException {
			while (!tokenizer.hasMoreTokens())
				tokenizer = new StringTokenizer(reader.readLine());
			return tokenizer.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public void close() throws IOException {
			reader.close();
		}
	}

	public static void main(String[] args) {
		try {
			String t = in.next();
			int nbVk = 0;
			int oneAdd = 0;
			for (int i = 0; i < t.length() - 1; i++) {
				if (t.charAt(i) == 'V' && t.charAt(i + 1) == 'K') {
					nbVk++;
					i++;
				} else if (oneAdd == 0) {
					if (i < t.length() - 2 && t.charAt(i + 1) == 'V' && t.charAt(i + 2) == 'K') {
					} else if (t.charAt(i) == 'V' || t.charAt(i + 1) == 'K') {
						oneAdd = 1;
						i++;
					}
				}
			}
			System.out.println(nbVk + oneAdd);
			in.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}

import java.util.*;
import java.lang.*;
public class Main
{
	public static void main(String[] args) {
	    Scanner sc=new Scanner(System.in);
	    String s=sc.next();
	    int ans=(s.length()-s.replace("VK","").length())>>1;
	    s=s.replace("VK",".");
	    System.out.println(ans+((s.contains("VV") || s.contains("KK"))?1:0));
	}

}

import java.util.Scanner;

public class HarmfulKeyboard {

	public static void main(String[] args) throws Exception {
		Scanner in = new Scanner(System.in);
		String inStr = in.nextLine();
		in.close();

		int maxOccurrence = getCountOccurrence(inStr);

		for (int r = 0; r < inStr.length(); r++) {
			StringBuilder varStr = new StringBuilder(inStr);
			varStr.setCharAt(r, inStr.charAt(r) == 75 ? 'V' : 'K');

			int maxVarOccurrence = getCountOccurrence(varStr.toString());

			if (maxVarOccurrence > maxOccurrence) {
				maxOccurrence = maxVarOccurrence;
			}
		}

		System.out.println(maxOccurrence);
	}

	public static int getCountOccurrence(String str) {
		int countOccurrence = 0;

		for (int i = 0; i < str.length() - 1; i++) {
			String curStr = String.valueOf(str.charAt(i));
			String nextStr = String.valueOf(str.charAt(i + 1));

			if ((curStr + nextStr).equals("VK")) {
				countOccurrence += 1;
			}
		}

		return countOccurrence;
	}
}

/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
If I'm the sun, you're the moon
Because when I go up, you go down
*******************************
*/
import java.util.*;
import java.io.*;

   public class Macro
   {
      public static void main(String args[]) throws Exception
      {
         //BufferedReader infile = new BufferedReader(new FileReader("cowdate.in"));
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));
         StringTokenizer st = new StringTokenizer(infile.readLine());
         String input = st.nextToken();
         int N = input.length();
         if(N == 1)
         {
             System.out.println(0);
             return;
         }
         char[] arr = input.toCharArray();
         int res = 0;
         for(int i=0; i < N-1; i++)
            if(arr[i] == 'V' && arr[i+1] == 'K')
                res++;
        boolean yee = false;
         for(int i=0; i < N-2; i++)
             if(arr[i] == arr[i+1] && arr[i] == arr[i+2])
                yee = true;
        if(arr[0] == arr[1] && arr[0] == 'K')
            yee = true;
        if(arr[N-1] == arr[N-2] && arr[N-1] == 'V')
            yee = true;
        if(yee)
            res++;
        System.out.println(res);
      }
}

import java.util.Scanner;

public class ViciousKeyboard {
	public static void main(String [] args){
		Scanner sc = new Scanner(System.in);
		String Test = sc.next();
		sc.close();
		boolean [] x = new boolean [Test.length()] ;
		for(int i = 0 ; i < Test.length() ; i ++)
			x[i] = false ;
		int Counter = 0 ;
		boolean Possible1 = false ;
		for(int i = 0 ; i < Test.length()-1 ; i ++){
			if(Test.charAt(i) == 'V' && Test.charAt(i+1) =='K'){
				Counter ++ ;
				x[i]= true;
				x[i+1]= true;}
			}
		for(int i = 0 ; i < Test.length()-1 ; i ++){
			if(Test.charAt(i) == 'V' && Test.charAt(i+1) =='V' && x[i+1] != true){
				Possible1 = true;}
			if(Test.charAt(i) == 'K' && Test.charAt(i+1) =='K' && x[i] != true)	{
				Possible1 = true ;}}
		if(Possible1)
			Counter ++ ;
		System.out.println(Counter);
		}
}

import java.util.Scanner;

/**
 * Created by alexwu on 2017/5/4.
 */
public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String input = sc.next();

        int flag = 0;
        int pos = 0;
        int ans = 0;
        for (int i = 0; i < input.length(); ) {
            if (i+1 < input.length() && input.charAt(i) == 'V' && input.charAt(i + 1) == 'K') {
                i += 2;
                ans++;
                pos = i;
            } else if (flag == 0 && i > pos && input.charAt(i) == input.charAt(i-1)) {
                flag = 1;
                i += 1;
            } else {
                i++;
            }
        }

        System.out.println(ans + flag);
    }
}

import java.util.*;
import java.io.*;

public class Vk {

	public static void main(String[] args) throws Exception {

		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		StringTokenizer st = new StringTokenizer(f.readLine());

		String in = st.nextToken();
		int max = 0;
		int count = 0;

		for(int j = 0; j < in.length()-1; j++) {
			if(in.substring(j, j+2).equals("VK")) {
				count++;
			}
		}
		if(count > max) {
			max = count;
		}
		count = 0;
		for(int i = 0; i < in.length(); i++) {
			if(in.charAt(i) == 'V') {
				String a = in.substring(0, i) + "K" + in.substring(i+1);
				for(int j = 0; j < a.length()-1; j++) {
					if(a.substring(j, j+2).equals("VK")) {
						count++;
					}
				}
				if(count > max) {
					max = count;
				}
				count = 0;
			} else {
				String a = in.substring(0, i) + "V" + in.substring(i+1);
				for(int j = 0; j < a.length()-1; j++) {
					if(a.substring(j, j+2).equals("VK")) {
						count++;
					}
				}
				if(count > max) {
					max = count;
				}
				count = 0;
			}
		}
		out.println(max);
		out.close();
		}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.*;
import java.lang.*;
import java.applet.*;
public class Main {

    public static void main(String[] args) {
        Scanner sc= new Scanner (System.in);
        String a=sc.next();

        int num=0;
        while(a.contains("VK"))
        {
            a=a.replaceFirst("VK","I");
            num++;
        }
        if(a.contains("VV")||a.contains("KK"))
            num++;
        System.out.println(num);

    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author zodiacLeo
 */
public class Main
{
    public static void main(String[] args)
    {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        FastPrinter out = new FastPrinter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA
    {
        public void solve(int testNumber, FastScanner in, FastPrinter out)
        {
            String before = in.next();
            String after = before.replaceAll("VK", "-");
            int cnt = (before.length() - after.length());
            if (after.length() >= 2)
            {
                int index = after.indexOf("VV");
                if (index >= 0 && index < after.length())
                {
                    cnt++;
                    out.println(cnt);
                    return;
                }

                index = after.lastIndexOf("KK");
                if (index >= 0 && index < after.length())
                {
                    cnt++;
                    out.println(cnt);
                    return;
                }
            }
            out.println(cnt);
        }

    }

    static class FastScanner
    {
        public BufferedReader br;
        public StringTokenizer st;

        public FastScanner(InputStream is)
        {
            br = new BufferedReader(new InputStreamReader(is));
        }

        public FastScanner(File f)
        {
            try
            {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e)
            {
                e.printStackTrace();
            }
        }

        public String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                String s = null;
                try
                {
                    s = br.readLine();
                } catch (IOException e)
                {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

    }

    static class FastPrinter extends PrintWriter
    {
        public FastPrinter(OutputStream out)
        {
            super(out);
        }

        public FastPrinter(Writer out)
        {
            super(out);
        }

    }
}

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
// package vicious.keyboard;

import java.util.Scanner;

/**
 *
 * @author Mostafa
 */
public class ViciousKeyboard {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner in = new Scanner(System.in);
        String s = in.next() ;
        byte n = 0 , v = 0 ;
        for ( int i = 0 ; i < s.length() - 1 ; ++i )
            if ( s.charAt(i) == 'V' && s.charAt(i+1) == 'K' )
                ++n ;
            else if ( i + 2 < s.length() && s.charAt(i) == 'V' && s.charAt(i+1) == 'V' && s.charAt(i+2) == 'V' )
                ++v ;
            else if ( i+2 == s.length() && s.charAt(i) == 'V' && s.charAt(i+1) == 'V'  )
                ++v ;
            else if ( i -1 >=0  && s.charAt(i) == 'K' && s.charAt(i+1) == 'K'&&s.charAt(i-1) == 'K' )
                ++v ;
            else if ( i == 0 && s.charAt(i) == 'K' && s.charAt(i+1) == 'K'  )
                ++v ;
        if ( v > 0 )
            ++n ;
        System.out.println(n);
    }

}

import java.io.*;
import java.util.*;
import java.math.*;

public class _409div2Q1
{
    public static void main(String[] args) throws IOException
    {
        FastScanner obj = new FastScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));
      	String str = obj.next();
      	int l = str.length();

      	if(l==1)
      		out.print(0);
		else if(l==2)
		{
			if(str.equals("KV"))
				out.print(0);
			else
				out.print(1);
		}
      	else
      	{
      		int ans = 0;
      		int flag = 0;
      		Set<Integer> st = new HashSet<Integer>();
      		for(int i=0;i<l-1;i++)
      		{
      			char c = str.charAt(i);
      			char c2 = str.charAt(i+1);
      			String s = "";
      			s += c;
      			s += c2;

      			if(s.equals("VK"))
      			{
      				ans++;
					st.add(i);
					st.add(i+1);
					i++;
      			}
      		}
      		for(int i=0;i<l-1;i++)
      		{
      			if(st.contains(i) || st.contains(i+1))
      				continue;

      			char c = str.charAt(i);
      			char c2 = str.charAt(i+1);
      			String s = "";
      			s += c;
      			s += c2;

  				if(!s.equals("KV"))
  				{
  					ans++;
  					break;
  				}

      		}
      		out.println(ans);
      	}
        out.close();
   }

   //-----------PrintWriter for faster output---------------------------------
   public static PrintWriter out;

   //-----------FastScanner class for faster input----------
   public static class FastScanner {
        BufferedReader br;
        StringTokenizer tokenizer;

        public FastScanner() throws IOException {
            br = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = new StringTokenizer(br.readLine().trim());
        }

        String next() {
            while (tokenizer == null || !tokenizer.hasMoreElements()) {
                try {
                    tokenizer = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                    }
            }
          return tokenizer.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        int[] nextIntArray() throws IOException {
            String[] line = br.readLine().trim().split(" ");
            int[] out = new int[line.length];

            for (int i = 0; i < line.length; i++) {
                out[i] = Integer.valueOf(line[i]);
            }
            return out;
        }

        BigInteger nextBigInteger() throws IOException {
            return new BigInteger(next());
        }

        String nextLine(){
            String str = "";
	        try {
	            str = br.readLine();
	        } catch (IOException e) {
	            e.printStackTrace();
	        }
	        return str;
        }

   }
   //--------------------------------------------------------
}

import java.util.*;
import java.lang.*;
public class Main
{
	public static void main(String[] args) {
	    Scanner sc=new Scanner(System.in);
	    char c[]=sc.next().toCharArray();
	    int n=c.length;
	    boolean one=false;
	    int ans=0;
	    for(int i=0;i<n-1;i++){
	        if(c[i]=='V' && c[i+1]=='K'){
	            c[i]='.';c[i+1]='.';ans++;
	        }
	    }
	    for(int i=0;i<n-1;i++){
	        if(c[i]=='K' && c[i+1]=='K')one=true;
	        if(c[i]=='V' && c[i+1]=='V')one=true;
	    }
	    System.out.println(ans+(one?1:0));
	}

}

import java.util.Scanner;

public class solution {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String a=sc.nextLine();
		String b="";
		int counter=0;
		int vkCounter=0;
		if(a.length()<2)
			System.out.println(counter);

		else{
			for (int i = 0; i < a.length(); i++) {

				if(i!=a.length()-1 && a.charAt(i)=='V' && a.charAt(i+1)=='K'  ){
					b+="XX";
					i++;
					vkCounter++;
				}
				else
					b+=a.charAt(i);
			}

			for (int i = 0; i < b.length(); i++) {
				if(i!=b.length()-1 &&b.charAt(i)!='X' && b.charAt(i+1)!='X'){
					if((b.charAt(i)=='K'&& i!=b.length()-1 &&b.charAt(i+1)!='V')|| (b.charAt(i)=='V' && i!=b.length()-1)){
						vkCounter++;
						break;
					}
				}
			}

			System.out.println(vkCounter);
			}
	}
}

import java.util.Scanner;
import java.util.StringTokenizer;

public class A2 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String  q = sc.nextLine();
		int m = count(q);
		//System.out.println("Best: "+m);
		for (int i = 0;i < q.length();i++){
			char[] v = q.toCharArray();
			switch(q.charAt(i)){
			case 'V':
				v[i] = 'K';
				m = Math.max(m, count(String.valueOf(v)));
				break;
			case 'K':
				v[i] = 'V';
				m = Math.max(m, count(String.valueOf(v)));
				break;
			}
			//String r = v.toString();
			//System.out.println("Best: "+m);

		}
		System.out.println(m);
	}
	public static int count(String str){
		String findStr = "VK";
		int lastIndex = 0;
		int count = 0;

		while(lastIndex != -1){

		    lastIndex = str.indexOf(findStr,lastIndex);

		    if(lastIndex != -1){
		        count ++;
		        lastIndex += findStr.length();
		    }
		}
		return count;
	}
}

import java.util.*;
import java.io.*;

	public class ProblemA {

		static class OutputWriter {
		private final PrintWriter writer;

		public OutputWriter(OutputStream outputStream) {
			writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		}

		public OutputWriter(Writer writer) {
			this.writer = new PrintWriter(writer);
		}

		public void print(Object...objects) {
			for (int i = 0; i < objects.length; i++) {
				if (i != 0)
					writer.print(' ');
				writer.print(objects[i]);
			}
		}

		public void printLine(Object...objects) {
			print(objects);
			writer.println();
		}

		public void close() {
			writer.close();
		}

		public void flush() {
			writer.flush();
		}

		}

		static class Reader
		{
		    final private int BUFFER_SIZE = 1 << 16;
		    private DataInputStream din;
		    private byte[] buffer;
		    private int bufferPointer, bytesRead;

		    public Reader()
		    {
		        din = new DataInputStream(System.in);
		        buffer = new byte[BUFFER_SIZE];
		        bufferPointer = bytesRead = 0;
		    }

		    public Reader(String file_name) throws IOException
		    {
		        din = new DataInputStream(new FileInputStream(file_name));
		        buffer = new byte[BUFFER_SIZE];
		        bufferPointer = bytesRead = 0;
		    }

		    public String readLine() throws IOException
		    {
		        byte[] buf = new byte[50000]; // line length
		        int cnt = 0, c;
		        while ((c = read()) != -1)
		        {
		            if (c == '\n')
		                break;
		            buf[cnt++] = (byte) c;
		        }
		        return new String(buf, 0, cnt);
		    }

		    public int nextInt() throws IOException
		    {
		        int ret = 0;
		        byte c = read();
		        while (c <= ' ')
		            c = read();
		        boolean neg = (c == '-');
		        if (neg)
		            c = read();
		        do
		        {
		            ret = ret * 10 + c - '0';
		        }  while ((c = read()) >= '0' && c <= '9');

		        if (neg)
		            return -ret;
		        return ret;
		    }

		    public long nextLong() throws IOException
		    {
		        long ret = 0;
		        byte c = read();
		        while (c <= ' ')
		            c = read();
		        boolean neg = (c == '-');
		        if (neg)
		            c = read();
		        do {
		            ret = ret * 10 + c - '0';
		        }
		        while ((c = read()) >= '0' && c <= '9');
		        if (neg)
		            return -ret;
		        return ret;
		    }

		    public double nextDouble() throws IOException
		    {
		        double ret = 0, div = 1;
		        byte c = read();
		        while (c <= ' ')
		            c = read();
		        boolean neg = (c == '-');
		        if (neg)
		            c = read();

		        do {
		            ret = ret * 10 + c - '0';
		        }
		        while ((c = read()) >= '0' && c <= '9');

		        if (c == '.')
		        {
		            while ((c = read()) >= '0' && c <= '9')
		            {
		                ret += (c - '0') / (div *= 10);
		            }
		        }

		        if (neg)
		            return -ret;
		        return ret;
		    }

		    private void fillBuffer() throws IOException
		    {
		        bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
		        if (bytesRead == -1)
		            buffer[0] = -1;
		    }

		    private byte read() throws IOException
		    {
		        if (bufferPointer == bytesRead)
		            fillBuffer();
		        return buffer[bufferPointer++];
		    }

		    public void close() throws IOException
		    {
		        if (din == null)
		            return;
		        din.close();
		    }
		}

		static class InputReader {

			private InputStream stream;
			private byte[] buf = new byte[5000];
			private int curChar;
			private int numChars;
			private SpaceCharFilter filter;

			public InputReader(InputStream stream) {
				this.stream = stream;
			}

			public int read() {
				if (numChars == -1)
					throw new InputMismatchException();
				if (curChar >= numChars) {
					curChar = 0;
					try {
						numChars = stream.read(buf);
					} catch (IOException e) {
						throw new InputMismatchException();
					}
					if (numChars <= 0)
						return -1;
				}
				return buf[curChar++];
			}

			public int readInt() {
				int c = read();
				while (isSpaceChar(c))
					c = read();
				int sgn = 1;
				if (c == '-') {
					sgn = -1;
					c = read();
				}
				int res = 0;
				do {
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					res *= 10;
					res += c - '0';
					c = read();
				} while (!isSpaceChar(c));
				return res * sgn;
			}

			public String readString() {
				int c = read();
				while (isSpaceChar(c))
					c = read();
				StringBuilder res = new StringBuilder();
				do {
					res.appendCodePoint(c);
					c = read();
				} while (!isSpaceChar(c));
				return res.toString();
			}

			public boolean isSpaceChar(int c) {
				if (filter != null)
					return filter.isSpaceChar(c);
				return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
			}

			public String next() {
				return readString();
			}

			public interface SpaceCharFilter {
				public boolean isSpaceChar(int ch);
			}
		}
		public static void main(String[] args)throws IOException{
			InputReader in=new InputReader(System.in);
			OutputWriter out=new OutputWriter(System.out);
			String S=in.readString();
			char[] s=S.toCharArray();
			int len=S.length();
			int count=0;
			int flag=0;
			for(int i=0;i<S.length();i++){
				if(S.charAt(i)=='V'){
					if(i+1<len && S.charAt(i+1)=='K'){
						count++;
						i++;
					}
					else if(i+1<len && S.charAt(i+1)=='V' && flag==0){
						if((i+2<len && S.charAt(i+2)=='V') || i+2>=len){
						flag=1;
						count++;
						}
					}
				}
				else{
					if(i-1>=0 && S.charAt(i-1)=='K' && flag==0){
						if((i-2>=0 && S.charAt(i-2)=='K') || i-2<0){
							flag=1;
							count++;
							}
					}
				}
			}
			System.out.print(count);

		}
	}

import java.io.*;
import java.util.InputMismatchException;

public class TaskA
{
	public static void main(String[] args)
	{
		new TaskA(System.in, System.out);
	}

	static class Solver
	{
		BufferedReader in;
		PrintWriter out;

		void solve() throws IOException
		{
			char[] line = in.readLine().toCharArray();
			int len = line.length;
			int cnt = 0;
			boolean changed = false;

			for (int i = 0; i < len - 1; i++)
			{
				if (line[i] == 'V' && line[i + 1] == 'K')
					i++;
				else if (!changed && line[i] == 'V' && line[i + 1] == 'V')
				{
					if (i < len - 2 && line[i + 2] == 'V')
					{
						line[i + 1] = 'K';
						changed = true;
					}
					else if (i >= len - 2)
					{
						line[i + 1] = 'K';
						changed = true;
					}
				}
				else if (!changed && line[i] == 'K' && line[i + 1] == 'K')
				{
					line[i] = 'V';
					changed = true;
				}
			}

			for (int i = 0; i < len - 1; i++)
				if (line[i] == 'V' && line[i + 1] == 'K')
					cnt++;

//			System.out.println("line : " + new String(line));
			out.println(cnt);
		}

		public Solver(BufferedReader in, PrintWriter out)
		{
			this.in = in;
			this.out = out;
		}

	}

	public TaskA(InputStream inputStream, OutputStream outputStream)
	{
		BufferedReader in = new BufferedReader(new InputStreamReader(inputStream));
		PrintWriter out = new PrintWriter(outputStream);
		Solver solver = new Solver(in, out);

		try
		{
			solver.solve();
			in.close();
		}
		catch (IOException e)
		{
			e.printStackTrace();
		}

		out.flush();
		out.close();
	}

}

import java.util.Scanner;

import javax.print.attribute.standard.MediaSize.ISO;

public class May_2 {

	public static void main(String [] args) {
		Scanner in = new Scanner(System.in);
		String str = in.nextLine();
//		System.out.println(str.substring(0, 4) + str.substring(6));
		System.out.println(caclVkCount(str));
	}

	public static int caclVkCount(String str) {
		int res = 0;
		boolean inc = false;
		if(str.equals("VV") || str.equals("KK"))
			return 1;
		for(int i=0; i<str.length()-1; i++) {
			if(str.charAt(i) == 'V' && str.charAt(i+1) == 'K'){
				res++;
			}
			else if(i<str.length()-2 && str.charAt(i+2) == 'V' && str.charAt(i+1) == 'V' && str.charAt(i) == 'V')
				inc = true;
			else if(i<str.length()-2 && str.charAt(i+2) == 'K' && str.charAt(i+1) == 'K' && str.charAt(i) == 'K')
				inc = true;
			else if((i<str.length()-2 && str.charAt(i) == 'K' && str.charAt(i+1) == 'K' && str.charAt(i+2) == 'V')
					&& (i==0 || str.charAt(i-1) == 'K'))
				inc = true;
		}
		if(str.length() > 1 && str.charAt(str.length()-2) == 'V' && str.charAt(str.length()-1) == 'V')
			inc = true;
		if(inc)
			return res + 1;
		else return res;
	}

	public static void f_807_b() {

		Scanner in = new Scanner(System.in);

		int p = in.nextInt();
		int x = in.nextInt();
		int y = in.nextInt();
		int myScore = x;
		int res = 0;
		while(myScore >= y) {
			if(isOk(myScore, p)) {
				res = 1;
				break;
			}
			myScore -= 50;
		}
		myScore = x;
		int i=0;
		while(res == 0) {
			myScore += 50;
			i++;
			if(isOk(myScore, p)) {
				break;
			}
		}
		if(res == 1)
			System.out.println("0");
		else
			System.out.println((i+1)/2);

	}

	public static boolean isOk(int myScore, int myRank) {
		int i = (myScore/50) % 475;
		for(int j =0 ; j<25; j++) {
			i = (i*96 + 42) % 475;
			if((i+26) == myRank)
				return true;
		}
		return false;
	}

}

    import java.util.*;

    public class viciousKeyBoard
    {
    	public static void main(String[] args)
    	{
    		Scanner sc=new Scanner(System.in);
    		String str=sc.next();
    		char [] ch=str.toCharArray();
    		int count=0;
    		int index=str.indexOf("VK");
    		while(index!=-1)
    		{
    			count++;
    			ch[index]='*';
    			ch[index+1]='*';
    			str=new String (ch);
    			index=str.indexOf("VK");
    		}

    		if(str.contains("VV")||str.contains("KK"))
    		{
    			count++;
    		}
    		System.out.println(count);
    	}
    }

import java.util.Scanner;

public class A2 {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		char[] input = scan.nextLine().toCharArray();
		if (input.length == 1) { System.out.println(0); return; }
		int ans = check(input);
		for (int j=0; j<input.length; j++) {
			if (input[j] == 'V') input[j] = 'K';
			else input[j] = 'V';
			ans = Math.max(ans, check(input));
			if (input[j] == 'V') input[j] = 'K';
			else input[j] = 'V';
		}
		System.out.println(ans);
	}

	public static int check(char[] input) {
		int ans=0;
		for (int i=0; i<input.length-1; i++) {
			if (input[i] == 'V' && input[i+1] == 'K') {
				ans++;

			}
		}
		return ans;
	}

}

import java.util.Scanner;

public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        String in = sc.nextLine();

        int length = in.length();

        int max = occurance(new StringBuilder(in));

        for(int i = 0; i < length; i++) {
            char replace = 'K';

            if(in.charAt(i) == 'K')
                replace = 'V';

            StringBuilder temp = new StringBuilder(in);
            temp.setCharAt(i, replace);

            int result = occurance(temp);

            if(result > max)
                max = result;
        }

        System.out.println(max);
    }

    public static int occurance(StringBuilder z) {
        int count = 0;

        int a = z.indexOf("VK");

        while(a != -1) {
            count++;
            z.setCharAt(a, ' ');
            z.setCharAt(a + 1, ' ');
            a = z.indexOf("VK");
        }

        return count;
    }
}

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String input = br.readLine();

		int count = 0;
		boolean[] stat = new boolean[input.length()];

		for(int i=0; i<input.length()-1; i++) {
			if(input.charAt(i) == 'V' && input.charAt(i+1) == 'K') {
				stat[i] = true;
				stat[i+1] = true;

				++count;
			}
		}

		for(int i=0; i<input.length()-1; i++) {
			if(stat[i] == false && stat[i+1] == false) {
				if(input.charAt(i) == 'V') {
					++count;
					break;
				} else if(input.charAt(i+1) == 'K') {
					++count;
					break;
				}
			}
		}

		System.out.println(count);
	}
}

import java.awt.Point;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.NavigableMap;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

public class avk17 {

	static class Task {

		public void Solve(InputReader in,PrintWriter out)
		{
			String s="VK";
			String s1="VV";
			String s2="KK";
			String t=in.next();
			int count=0;
			for(int i=0;i<t.length()-1;i++)
			{
				if(t.substring(i,i+2).equals(s))
					count++;
			}
			String ans=t.replaceAll(s,"H");

			for(int i=0;i<ans.length()-1;i++)
			{
				if(ans.substring(i, i+2).equals(s1) | ans.substring(i,i+2).equals(s2))
				{
					out.print(count+1);
					return;
				}
			}
			out.println(count);

		}
	}

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        Task solve = new Task();
        solve.Solve(in,out);
        out.close();
    }

    static void sortArray(int arr[][]){
        Arrays.sort(arr,new java.util.Comparator<int[]>(){
        public int compare(int[] a, int[] b) {
            return Integer.compare(a[0], b[0]);
        }});
    }

    static void sortArray(int arr[]){
		int cnt[]=new int[(1<<16)+1];
		int ys[]=new int[arr.length];
		for(int j=0;j<=16;j+=16){
			Arrays.fill(cnt,0);
			for(int x:arr){cnt[(x>>j&0xFFFF)+1]++;}
			for(int i=1;i<cnt.length;i++){cnt[i]+=cnt[i-1];}
			for(int x:arr){ys[cnt[x>>j&0xFFFF]++]=x;}
			{ final int t[]=arr;arr=ys;ys=t;}
		}
		if(arr[0]<0||arr[arr.length-1]>=0)return;
		int i,j,c;
		for(i=arr.length-1,c=0;arr[i]<0;i--,c++){ys[c]=arr[i];}
		for(j=arr.length-1;i>=0;i--,j--){arr[j]=arr[i];}
		for(i=c-1;i>=0;i--){arr[i]=ys[c-1-i];}
	}

	static int[] di={1,0,-1,0,1,-1,-1,1};
	static int[] dj={0,1,0,-1,1,1,-1,-1};

    static int min(int x,int y){return x<y?x:y;}
    static int max(int x,int y){return x>y?x:y;}
    static int lcm(int a,int b){return a*b/gcd(a,b);}
    static int gcd(int a,int b){return b==0?a:gcd(b,a%b);}
    static int abs(int x){if(x>=0)return x;else return -x;}

    static long min(long x,long y){return x<y?x:y;}
    static long max(long x,long y){return x>y?x:y;}
    static long lcm(long a,long b){return a*b/gcd(a,b);}
    static long gcd(long a,long b){return b==0?a:gcd(b,a%b);}
    static long abs(long x){if(x>=0)return x;else return -x;}

    static void joutArray(int arr[]){
    	for(int i=0;i<arr.length;i++){
    		System.out.print(arr[i]+" ");
    	}
    	System.out.println();
    }

    static void joutArray(int arr[][],int n,int m){
    	for(int i=0;i<n;i++){
    		for(int j=0;j<m;j++)
    		System.out.print(arr[i][j]+" ");
    		System.out.println();
    	}
    	System.out.println();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextLine() {
			String fullLine=null;
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					fullLine=reader.readLine();
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
				return fullLine;
			}
			return fullLine;
		}

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
        	return Long.parseLong(next());
        }

        public double nextDouble() {
        	return Double.parseDouble(next());
        }

        public int[] nextIntArray(int n) {
        	int arr[]=new int[n];
        	for(int i=0;i<n;i++)
        		arr[i]=nextInt();
        	return arr;
        }

        public char[] nextCharArray(){
        	char arr[]=next().toCharArray();
        	return arr;
        }

        public HashMap<Integer,Integer> inHashMap(int n){
        	HashMap<Integer,Integer> hm=new HashMap<>();
        	for(int i=0;i<n;i++){
    			int num=nextInt();
    			hm.put(num,hm.get(num)==null?1:hm.get(num)+1);
    		}
        	return hm;
        }
     }

   }

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class ViciousKeyboard {
  public static void main(String[] args) {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
           InputReader in = new InputReader(inputStream);
            PrintWriter out = new PrintWriter(outputStream);
           TaskA solver = new TaskA();
            solver.solve(1, in, out);
            out.flush();
    }
  static class TaskA{
        void solve(int t,InputReader in,PrintWriter out){
            char str[] = in.next().toCharArray();
            int ans = 0 ,res = 0, n = str.length;
             char str2[];
            for(int i = 0;i+1 < n;i++){
                res += str[i] == 'V' && str[i+1] == 'K' ? 1 : 0;
            }

            for (int k = 0; k <= n-1; ++k) {
		str2 = str;
    		if (str2[k] == 'V')
			str2[k] = 'K';
		else str2[k] = 'V';
		ans = 0;
		for (int i = 0; i <= n-2; ++i)
			ans += str2[i] == 'V' && str2[i + 1] == 'K' ? 1 : 0;

		res = Math.max(res, ans);

                if (str2[k] == 'V')
			str2[k] = 'K';
		else str2[k] = 'V';
            }

            out.println(res);
        }
  }
     static class InputReader{
        public BufferedReader reader;
        public StringTokenizer tk;
        public InputReader(InputStream stream){
           reader = new BufferedReader(new InputStreamReader(stream));
           tk = null;
        }
         String next(){
            while (tk == null || !tk.hasMoreTokens()) {
                try{
                    tk = new StringTokenizer(reader.readLine());
                }
                catch(IOException e){
                    throw new RuntimeException(e);
                }
            }
            return tk.nextToken();
        }
         int nextInt(){
         return Integer.parseInt(next());
        }
    }
}

import java.util.Scanner;

public class JavaApplication1 {

    public static void main(String[] args) {

       // System.out.println("hello");\
       Scanner s=new Scanner(System.in);
       String str=s.next();
       int count=0;
       for(int i=0;i<str.length()-1;i++)
       {
           if(str.charAt(i)=='V' && str.charAt(i+1)=='K')
               count++;
       }

       if(str.length()==1)
           System.out.println("0");
       else if(str.length()==2)
       {
           if(str.equalsIgnoreCase("vk"))
               System.out.println("1");
           else if(str.equalsIgnoreCase("vv"))
               System.out.println("1");
             else if(str.equalsIgnoreCase("KK"))
               System.out.println("1");
           else
               System.out.println("0");
       }
       else
       {
           if(str.contains("VVV"))
               System.out.println(count+1);
           else if(str.contains("KKK"))
               System.out.println(count+1);
           else if(str.startsWith("KK"))
               System.out.println(count+1);

            else if(str.endsWith("VV"))
               System.out.println(count+1);
           else System.out.println(count);

       }

    }

}

import java.util.*;
public class Main
{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		int c=0;
		boolean flag=true;
		for(int i=0;i<s.length();i++){
			char a=s.charAt(i);
			if(a=='V'){
			    if(i+1<s.length()){
		             if(s.charAt(i+1)=='K'){
						 c++;
						 if(flag){
							 if(s.substring(0,i).contains("VV") || s.substring(0,i).contains("KK")){
								 c++;
								 flag=false;
							 }
						 }
						 s=s.substring(i+2,s.length());
						 i=-1;
					 }
				}
			}
		}
		if(flag){
			if(s.contains("VV") || s.contains("KK")){
				c++;
			}
		}
		System.out.println(c);
	}
}

import java.util.*;

public class AA {

    static Scanner in = new Scanner(System.in);
    static String S;

    public static void main(String[] args) {
        S = in.next();
        String aux = "";
        int max = OccVK(), inter;
        if (S.length() == 1) {
            System.out.println("0");
        } else {
            for (int i = 0; i < S.length(); i++) {
                aux = S;
                if (aux.charAt(i) == 'V') {
                    aux = aux.substring(0, i) + "K" + aux.substring(i + 1);
                    inter = OccVK(aux);
                    max = (inter > max) ? inter : max;
                }else{
                    aux = aux.substring(0, i) + "V" + aux.substring(i + 1);
                    inter = OccVK(aux);
                    max = (inter > max) ? inter : max;
                }
            }
            System.out.println(max);
        }
    }

    static int OccVK() {
        String aux = S;
        int count = 0, i = 0, j = 1;
        while (j < S.length() ) {
            if (S.charAt(i) == 'V' && S.charAt(j) == 'K') {
                count++;
            }
            i++;
            j++;
        }
        return count;
    }

    static int OccVK(String aux) {
        int count = 0, i = 0, j = 1;
        while (j < aux.length()) {
            if (aux.charAt(i) == 'V' && aux.charAt(j) == 'K') {
                count++;
            }
            i++;
            j++;
        }
        return count;
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class A {

    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String s = br.readLine();
            boolean lastv = s.charAt(0) == 'V';
            int[] n = new int[100];
            int idx = 0;
            n[idx] = 1;
            int ans = 0;
            for (int i = 1; i < s.length(); ++i) {
                if ((lastv && s.charAt(i) != 'V') || (!lastv && s.charAt(i) == 'V')) {
                    idx++;
                }
                lastv = s.charAt(i) == 'V';
                n[idx]++;
                if (n[idx] > 2 || (idx == 0 && n[idx] == 2 && !lastv)
                        || (i == s.length() - 1 && n[idx] == 2 && lastv)) {
                    ans = 1;
                }
            }
            if (s.charAt(0) == 'V') {
                idx++;
            }
            ans += idx / 2;
            if (s.length() == 2 && idx == 0) {
                ans = 1;
            }
            System.out.println(ans);
        } catch (IOException ex) {
        }
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            char arr[] = in.next().toCharArray();
            int ans = 0, cnt = 0;
            if (arr.length == 1) {
                out.print("0");
                return;
            }
            for (int i = 0; i < arr.length - 1; i++) {
                if (arr[i] == 'V' && arr[i + 1] == 'K') {
                    arr[i] = '.';
                    arr[i + 1] = '.';
                    ans++;
                }
            }
            for (int i = 0; i < arr.length - 1; i++) {
                if (arr[i] == 'V' && arr[i + 1] == 'V') {
                    cnt++;
                } else if (arr[i] == 'K' && arr[i + 1] == 'K') {
                    cnt++;
                }
            }
            if (cnt > 0) ans++;
            out.print(ans);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

    }
}

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class viciousKeyboard {

	public static void main(String[] args) throws IOException {

		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		String str = f.readLine();

		int c = 0;
		boolean add= false;

		if (str.length() == 1){

			c = 0;

		}else{

			for (int i = 0; i < str.length(); i++){

				if (i != str.length() - 1 && str.charAt(i) == 'V' && str.charAt(i+1) == 'K'){
					c++;
				}
				if (i !=  str.length() - 1 && i !=  str.length() - 2 && str.charAt(i) == 'V' && str.charAt(i+1) == 'V' && str.charAt(i+2) == 'V'){
					add = true;
				}
				if (i == str.length() - 2 && str.charAt(i) == 'V' && str.charAt(i+1) == 'V'){
					add = true;
				}
				if (i != 0 && i != 1 && str.charAt(i-2) == 'K' && str.charAt(i-1) == 'K' && str.charAt(i) == 'K'){
					add = true;
				}
				if (i == 1 && str.charAt(i-1) == 'K' && str.charAt(i) == 'K'){
					add = true;
				}

			}

			if (add){
				c++;
			}

		}

		System.out.print(c);
		System.out.close();

	}

}

import java.util.Scanner;

public class Vicious_Keyboard {
		public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String x = sc.nextLine();
		int c=0;
		int index = 0;
		while(index !=-1){
			index = x.indexOf("VK", index);
			if(index !=-1) {
				index += 2 ;
				c++;
			}
		}
		x = x.replaceAll("VK", "c");
		if(x.contains("KK") || x.contains("VV"))c++;

		System.out.println(c);
	}

}

import java.util.*;
import java.io.*;
import java.math.*;
import java.lang.*;

public class Main {
    private static FastReader sc = new FastReader(System.in);
    private static OutputWriter out = new OutputWriter(System.out);

    public static void main(String[] args) throws Exception {
        String s = sc.next();
        int n = s.length();
        int ans = 0;
        for (int i = 0; i < n; i++) {
            StringBuilder sb = new StringBuilder(s);
            if (s.charAt(i) == 'V') sb.setCharAt(i, 'K');
            else sb.setCharAt(i, 'V');
            ans = Math.max(ans, cnt(sb.toString()));
        }
        System.out.println(Math.max(ans, cnt(s)));
    }

    private static int cnt(String s) {
        int i = 0;
        int ans = 0;
        while (i < s.length() - 1) {
            if (s.substring(i, i + 2).equals("VK")) {
                ans++;
                i += 2;
            } else {
                i++;
            }
        }
        return ans;
    }
}

class FastReader {
    private boolean finished = false;

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public FastReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1) {
            throw new InputMismatchException();
        }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0) {
                return -1;
            }
        }

        return buf[curChar++];
    }

    public int peek() {
        if (numChars == -1) {
            return -1;
        }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                return -1;
            }
            if (numChars <= 0) {
                return -1;
            }
        }
        return buf[curChar];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c == ',') {
                c = read();
            }
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String nextString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        if (filter != null) {
            return filter.isSpaceChar(c);
        }
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private String readLine0() {
        StringBuilder buf = new StringBuilder();
        int c = read();
        while (c != '\n' && c != -1) {
            if (c != '\r') {
                buf.appendCodePoint(c);
            }
            c = read();
        }
        return buf.toString();
    }

    public String nextLine() {
        String s = readLine0();
        while (s.trim().length() == 0)
            s = readLine0();
        return s;
    }

    public String nextLine(boolean ignoreEmptyLines) {
        if (ignoreEmptyLines) {
            return nextLine();
        } else {
            return readLine0();
        }
    }

    public BigInteger nextBigInteger() {
        try {
            return new BigInteger(nextString());
        } catch (NumberFormatException e) {
            throw new InputMismatchException();
        }
    }

    public char nextCharacter() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        return (char) c;
    }

    public double nextDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E') {
                return res * Math.pow(10, nextInt());
            }
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E') {
                    return res * Math.pow(10, nextInt());
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }

    public boolean isExhausted() {
        int value;
        while (isSpaceChar(value = peek()) && value != -1)
            read();
        return value == -1;
    }

    public String next() {
        return nextString();
    }

    public SpaceCharFilter getFilter() {
        return filter;
    }

    public void setFilter(SpaceCharFilter filter) {
        this.filter = filter;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

    public void flush() {
        writer.flush();
    }

}

import java.io.*;
import java.util.*;

public class A {

	public static void main(String[] args) {
		FastScanner sc=new FastScanner();
		char[] ch = sc.next().toCharArray();
		int ans = 0;

		boolean flag = false;
		for(int i = 0; i<ch.length-1; i++) {
			if(ch[i] == 'V' && ch[i+1]=='K') {
				ch[i] = 's';
				ch[i+1] = 's';
				ans++;
				i++;
			}
		}

		for(int i = 0; i<ch.length-1; i++) {
			if((ch[i] == 'V' && ch[i+1]=='V') || (ch[i] =='K' && ch[i+1] =='K'))
				flag = true;
		}

		System.out.println(ans + (flag ? 1 : 0 ));
	}

	static final Random random = new Random();

	static void sort(int[] a) {
		int n = a.length;
		for(int i =0; i<n; i++) {
			int val = random.nextInt(n);
			int cur = a[i];
			a[i] = a[val];
			a[val] = cur;
		}
		Arrays.sort(a);
	}

	static void sortl(long[] a) {
		int n = a.length;
		for(int i =0; i<n; i++) {
			int val = random.nextInt(n);
			long cur = a[i];
			a[i] = a[val];
			a[val] = cur;
		}
		Arrays.sort(a);
	}

	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (st == null  || !st.hasMoreTokens()) {
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		String nextLine() {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
		}
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
		double nextDouble() {
            return Double.parseDouble(next());
        }
	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

//import java.util.Scanner;
public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        //Scanner in = new Scanner(System.in);
        String s = bf.readLine();
        byte c = 0;
        while (s.contains("VK")) {
            s = s.replaceFirst("VK", "S");
            c++;
        }
        System.out.println(s.contains("KK") || s.contains("VV") ? (c + 1) : c);
    }
}

import java.util.*;
public class As {

public static int ViciousKeyboard(String s){
	boolean flag=false;
	int count=0;
	for(int i=0;i<s.length()-1;i++){
		if(s.charAt(i)=='V'&&s.charAt(i+1)=='K'){
			count++;
			i++;
		}
		else if(s.length()<=2){
			if(s.charAt(i)=='V'&&s.charAt(i+1)=='V')
				flag=true;
			if(s.charAt(i)=='K'&&s.charAt(i+1)=='K')
				flag=true;
		}
		else if(s.length()>2){
			if(s.charAt(i)=='K'&&s.charAt(i+1)=='K')
				flag=true;
			if(s.charAt(i)=='V'&&s.charAt(i+1)=='V'){
				if(s.length()-1-i<2){
					flag=true;
					}
				else if(s.charAt(i+2)!='K'){
							flag=true;
							}

					}
		}
	}
	if(flag==true){
		count++;
	}
	return count;

}
public static void main(String[]args){
	Scanner sc=new Scanner(System.in);
	String in=sc.nextLine();
	int res=ViciousKeyboard(in);
	System.out.println(res);

}
}

import java.io.*;
import java.util.StringTokenizer;

public class Codeforces_round_409_div_2_ViciousKeyboard {

    public static void main(String[] args) {
        FScanner input = new FScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out), true);
        String line = input.nextLine();
        int answer = 0;
        for (int i = 0; i < line.length(); i++) {
            StringBuilder builder = new StringBuilder(line);
            if (line.charAt(i) == 'K') {
                builder.setCharAt(i, 'V');
                answer = Math.max(answer, getNum(builder.toString()));
            } else {
                builder.setCharAt(i, 'K');
                answer = Math.max(answer, getNum(builder.toString()));
            }
        }
        out.println(Math.max(answer, getNum(line)));
        out.close();
    }

    public static int getNum(String line) {
        int answer = 0;
        StringBuilder current = new StringBuilder();
        for (int i = 0; i < line.length(); i++) {
            if (current.length() >= 2) {
                current = current.deleteCharAt(0);
            }
            current = current.append(line.charAt(i));
            if (current.length() == 2 && current.toString().equals("VK")) {
                answer++;
            }
        }
        return answer;
    }

    public static PrintWriter out;

    public static class FScanner {
        BufferedReader br;
        StringTokenizer st;

        public FScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        private String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
}

import java.io.*;
import java.util.*;
public class Main {

	public static void main(String[] args) {
		FastScanner sc=new FastScanner();
		PrintWriter pw=new PrintWriter(System.out);
		while(sc.hasNext()){
			String s=sc.next();
			int num=0;
			int res=0;
			int n=0;
			char[]t=new char[s.length()];
			char[]t1=new char[s.length()];
			char[]t2=new char[s.length()];
			for(int i=0;i<s.length();i++) t[i]=s.charAt(i);
			for(int i=0;i<s.length()-1;i++){
				if(t[i]=='V'&&t[i+1]=='K'){
					num++;
				}
			}
			res=Math.max(num, res);
			for(int i=0;i<s.length();i++){
				for(int q=0;q<s.length();q++) t1[q]=s.charAt(q);
				t1[i]='V';
				num=0;
				for(int j=0;j<s.length()-1;j++){
					if(t1[j]=='V'&&t1[j+1]=='K'){
						num++;
					}
				}
				res=Math.max(num, res);
			}
			for(int i=0;i<s.length();i++){
				for(int q=0;q<s.length();q++) t2[q]=s.charAt(q);
				t2[i]='K';
				num=0;
				for(int j=0;j<s.length()-1;j++){
					if(t2[j]=='V'&&t2[j+1]=='K'){
						num++;
					}
				}
				res=Math.max(num, res);
			}
			res=Math.max(num, res);
			pw.println(res);
			pw.flush();
		}
	}

}
class FastScanner {
    BufferedReader br;
    StringTokenizer st;
    public FastScanner() {
        try	{
            br = new BufferedReader(new InputStreamReader(System.in));
            st = new StringTokenizer("");
        } catch (Exception e){e.printStackTrace();}
    }
    public boolean hasNext() {
        while (!st.hasMoreTokens()) {
            String line = nextLine();
            if (line == null) {
                return false;
            }
            st= new StringTokenizer(line);
        }
        return true;
    }
    public String next() {
        if (st.hasMoreTokens())	return st.nextToken();
        try {st = new StringTokenizer(br.readLine());}
        catch (Exception e) {e.printStackTrace();}
        return st.nextToken();
    }

    public int nextInt() {return Integer.parseInt(next());}

    public long nextLong() {return Long.parseLong(next());}

    public double nextDouble() {return Double.parseDouble(next());}

    public String nextLine() {
        String line = "";
        try {line = br.readLine();}
        catch (Exception e) {e.printStackTrace();}
        return line;
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Sid
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        A801 solver = new A801();
        solver.solve(1, in, out);
        out.close();
    }

    static class A801 {
        public void solve(int testNumber, InputReader in, OutputWriter out) {

            String s = in.nextString();
            int count = 0, flag = 0;
            boolean mode = false;
            for (int i = 0; i < s.length() - 1; i++) {
                if (s.charAt(i) == 'V' && s.charAt(i + 1) == 'K') {
                    count++;
                    flag = 1;
                }
                if (s.charAt(i) == 'V' && s.charAt(i + 1) == 'V') {
                    if (i < s.length() - 2) {
                        if (s.charAt(i + 2) != 'K')
                            mode = true;
                    }
                    if (i == s.length() - 2)
                        mode = true;
                }
                if (s.charAt(i) == 'K' && s.charAt(i + 1) == 'K') {
                    if (i == 0)
                        mode = true;
                    if (i > 0) {
                        if (s.charAt(i - 1) != 'V')
                            mode = true;
                    }
                }
                if (flag == 1) {
                    i++;
                    flag = 0;
                }
            }
            if (mode)
                count++;
            out.println(count);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public String nextString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                if (Character.isValidCodePoint(c)) {
                    res.appendCodePoint(c);
                }
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void println(int i) {
            writer.println(i);
        }

    }
}

import java.util.Scanner;
import java.util.StringTokenizer;

public class A2 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String  q = sc.nextLine();
		int m = count(q);
		//System.out.println("Best: "+m);
		for (int i = 0;i < q.length();i++){
			char[] v = q.toCharArray();
			switch(q.charAt(i)){
			case 'V':
				v[i] = 'K';
				m = Math.max(m, count(String.valueOf(v)));
				break;
			case 'K':
				v[i] = 'V';
				m = Math.max(m, count(String.valueOf(v)));
				break;
			}
			//String r = v.toString();
			//System.out.println("Best: "+m);

		}
		System.out.println(m);
	}
	public static int count(String str){
		String findStr = "VK";
		int lastIndex = 0;
		int count = 0;

		while(lastIndex != -1){

		    lastIndex = str.indexOf(findStr,lastIndex);

		    if(lastIndex != -1){
		        count ++;
		        lastIndex += findStr.length();
		    }
		}
		return count;
	}
}

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Arrays;
import java.math.BigInteger;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
     public static void main (String[] args) throws java.lang.Exception
     {
     	Scanner in =new Scanner(System.in);
		int t=1,n,i,m=0,k,h,p=0,x=0,o,y;
		String st,s1,s2,s3;
		st=in.next();
		n=st.length();
		char a[]=st.toCharArray();
		for(i=0;i<n-1;i++)
		{
		     if(a[i]!=a[i+1] && a[i]=='V')
		     {
		          p++;
		          a[i]='0';
		          a[i+1]='0';
		          i++;
		     }
		}
		for(i=0;i<n-1;i++)
		{
		     if(a[i]==a[i+1] && a[i]!='0')
		          x++;
		}
		if(x>0)
		     p++;
		System.out.println(p);
     }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class zizo {

	public static void main(String[]args) throws IOException {
		Scanner zizo=new Scanner(System.in);
		PrintWriter wr=new PrintWriter(System.out);

		String s=zizo.next();
		int r=0;
		if(s.contains("KKK")||s.contains("VVV")||(s.length()>1&&((s.charAt(s.length()-1)=='V'&&s.charAt(s.length()-2)=='V')||((s.charAt(1)=='K'&&s.charAt(0)=='K')))))
			r++;
		char[]c=s.toCharArray();
		for(int i=0;i<c.length-1;i++)
			if(s.charAt(i)=='V'&&s.charAt(i+1)=='K')
				r++;
		wr.println(r);

		wr.close();
	}
}
class edge implements Comparable<edge>{
	int m,s;
	edge(int a,int b){
		m=a;s=b;
	}
	@Override
	public int compareTo(edge o) {
		// TODO Auto-generated method stub
		return m-o.m;
	}

}
class Scanner
{
	StringTokenizer st;
	BufferedReader br;

	public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

	public String next() throws IOException
	{
		while (st == null || !st.hasMoreTokens())
			st = new StringTokenizer(br.readLine(), ",| ");
		return st.nextToken();
	}

	public int nextInt() throws IOException {return Integer.parseInt(next());}

	public long nextLong() throws IOException {return Long.parseLong(next());}

	public String nextLine() throws IOException {return br.readLine();}

	public boolean ready() throws IOException {return br.ready();}

	public double nextDouble() throws IOException
	{
		String x = next();
		StringBuilder sb = new StringBuilder("0");
		double res = 0, f = 1;
		boolean dec = false, neg = false;
		int start = 0;
		if(x.charAt(0) == '-')
		{
			neg = true;
			start++;
		}
		for(int i = start; i < x.length(); i++)
			if(x.charAt(i) == '.')
			{
				res = Long.parseLong(sb.toString());
				sb = new StringBuilder("0");
				dec = true;
			}
			else
			{
				sb.append(x.charAt(i));
				if(dec)
					f *= 10;
			}
		res += Long.parseLong(sb.toString()) / f;
		return res * (neg?-1:1);
	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class KeyBoard {

	private static String inputString = "";
	public static void main(String[] args) throws IOException {

		BufferedReader buffer=new BufferedReader(new InputStreamReader(System.in));
		String[] inputLine = buffer.readLine().split(" ");
		inputString = inputLine[0];
		printCalculateResult();
	}

	public KeyBoard(String input) {

		inputString = input;
	}

	public static int calculate() {

		int stringSize = inputString.length();
		int leftIndex = 0;
		int rightIndex = 1;
		int totalOccurrenceNumber = 0;
		boolean isToggled = false;

		while(rightIndex<stringSize) {

			if(inputString.charAt(leftIndex)=='V' && inputString.charAt(rightIndex)=='V') {

				if(!isToggled) {

					if(rightIndex+1<stringSize && inputString.charAt(rightIndex+1)=='K') {

						leftIndex++;
						rightIndex++;
					} else {

						// not yet toggled, so do toggling here.
						isToggled = true;
						totalOccurrenceNumber++;
						leftIndex+=2;
						rightIndex+=2;
					}
				} else {
					leftIndex++;
					rightIndex++;
				}
			} else if(inputString.charAt(leftIndex)=='V' && inputString.charAt(rightIndex)=='K') {

				totalOccurrenceNumber++;
				leftIndex+=2;
				rightIndex+=2;
			} else if(inputString.charAt(leftIndex)=='K' && inputString.charAt(rightIndex)=='K') {

				if(!isToggled) {

					// not yet toggled, so do toggling here.
					isToggled = true;
					totalOccurrenceNumber++;
					leftIndex+=2;
					rightIndex+=2;
				} else {
					leftIndex++;
					rightIndex++;
				}
			} else {

				// 'KV'
				leftIndex++;
				rightIndex++;
			}
		}

		return totalOccurrenceNumber;
	}

	public static void printCalculateResult() {

		System.out.println(calculate());
	}
}

import static java.lang.Math.*;
import static java.util.Arrays.* ;

import java.util.*;
import java.io.*;

public class D
{

    void main() throws Exception
    {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        char [] s = sc.next().toCharArray() ;
        int ans = 0 ;
        for(int j = 0 ; j < s.length - 1; j ++)
            if(s[j] == 'V' && s[j + 1] == 'K')
                    ans ++ ;

        for(int i = 0 ;i < s.length ; i++)
        {
            if(s[i] == 'V')
                s[i] = 'K' ;
            else if(s[i] == 'K')
                s[i] = 'V' ;
            int cnt = 0 ;
            for(int j = 0 ; j < s.length - 1; j ++)
                if(s[j] == 'V' && s[j + 1] == 'K')
                    cnt ++ ;
            ans = max(ans , cnt) ;

            if(s[i] == 'V')
                s[i] = 'K' ;
            else if(s[i] == 'K')
                s[i] = 'V' ;

        }
        out.println(ans);
        out.flush();
        out.close();
    }
    class Scanner
    {
        BufferedReader br;
        StringTokenizer st;

        Scanner(InputStream in)
        {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() throws Exception
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }
        String nextLine() throws Exception
        {
            return br.readLine() ;
        }
        int nextInt() throws Exception { return Integer.parseInt(next()); }

        long nextLong() throws Exception { return Long.parseLong(next()); }

        double nextDouble() throws Exception { return Double.parseDouble(next());}
    }

    public static void main (String [] args) throws Exception {(new D()).main();}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

//import java.util.Scanner;
public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        //Scanner in = new Scanner(System.in);
        String s = bf.readLine();
        byte c = 0;
        while (s.contains("VK")) {
            s = s.replaceFirst("VK", "S");
            c++;
        }
        if (s.contains("KK")||s.contains("VV")) {
            System.out.println((c + 1));
        } else {
            System.out.println((c));
        }
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Helloworld {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=br.readLine();
		int l=s.length();
		if(l==1) {
			System.out.println(0);
		}
		else if(l==2) {
			if(s.equals("KV")) {
				System.out.println(0);
			}
			else {
				System.out.println("1");
			}
		}
		else {
			int count=0;
			for(int i=0;i<l-1;i++) {
				if(s.substring(i,i+2).equals("VK")) {
					count++;
				}
			}
			if(s.substring(0, 2).equals("KK")) {
				count++;
			}
			else if(s.substring(l-2).equals("VV")) {
				count++;
			}
			else {
				for(int i=1;i<l-1;i++) {
					if(s.charAt(i)=='K') {
						if(s.charAt(i-1)!='V'&& s.charAt(i+1)!='V') {
							count++;
							break;
						}
					}
					else {
						if(s.charAt(i-1)!='K' && s.charAt(i+1)!='K') {
							count++;
							break;
						}
					}
				}
			}
			System.out.println(count);
		}
	}

}

import java.io.*;
import java.util.Scanner;

public class Solution {

    public static void main(String[] args) throws IOException {
        //BufferedReader in = new BufferedReader(new FileReader(new File("input.txt")));
        BufferedWriter out = new BufferedWriter(new FileWriter(new File("output.txt")));
        Scanner in = new Scanner(System.in);
        //BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        //PrintWriter pw = new PrintWriter(System.out, true);

        StringBuilder s = new StringBuilder(in.nextLine());
        int c = 0;
        if(s.length() < 2){
            System.out.println("0");
            System.exit(0);
        }
        while (s.indexOf("VK") > -1){
            s.replace(s.indexOf("VK"),s.indexOf("VK") + 2, "--");
            c++;
        }
        if(s.indexOf("KK") > -1){
            c++;
        }else if(s.indexOf("VV") > -1){
            c++;
        }
        System.out.println(c);
        in.close();
        out.close();
    }
}

import java.util.Scanner;

public class ViciousKeyboard {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner input = new Scanner(System.in);
		String s = input.next();
		int counter=0;
		for(int i=0; i<s.length()-1;i++){
			if(s.substring(i,i+2).equals("VK"))counter++;
		}
		//System.out.println(counter);
		boolean condition = false;
		int i;
		int j = 0;
		do{
		  i = s.indexOf("VV",j);
		if(i!=-1 && (i+2>=s.length() || s.charAt(i+2)!='K')){
			condition = true;
			break;

		}
		j = i+1;
		}while(i!=-1);
		 j=0;
		if(condition){
			System.out.println(counter+1);
			return;
		}
		do{
			i = s.indexOf("KK",j);
			if(i!=-1 && (i-1<0 || s.charAt(i-1)!='V')){
				condition = true;
				break;

			}
			j = i+1;

		}while(i!=-1);
		if(condition){
			System.out.println(counter+1);
		}
		else
			System.out.println(counter);
	}

}

import java.util.*;
import java.lang.*;
public class Main
{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	    String s = sc.next();
	    int n = s.length();
	    int c1 = 0;
	    int c2 = 0;
	    char c[] = s.toCharArray();
	    for(int i=0;i<n-1;i++){
	        if(c[i]=='V'&&c[i+1]=='K'){
	            c1++;
	            c[i]='a';
	            c[i+1]='b';
	            i++;
	        }
	    }
	    for(int i=0;i<n-1;i++){
	        if((c[i]=='V'&&c[i+1]=='V')||(c[i]=='K'&&c[i+1]=='K')){
	            c2++;
	            break;
	        }
	    }
	    if(c2==0) System.out.println(c1);
	    else System.out.println(c1+1);
	}
}

import java.io.*;
import java.util.*;

public class Vicious_Keyboard {

    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        char[] ch = sc.next().toCharArray();
        int ans = 0;

        boolean flag = false;
        for (int i = 0; i < ch.length - 1; i++) {
            if (ch[i] == 'V' && ch[i + 1] == 'K') {
                ch[i] = 's';
                ch[i + 1] = 's';
                ans++;
                i++;
            }
        }

        for (int i = 0; i < ch.length - 1; i++) {
            if ((ch[i] == 'V' && ch[i + 1] == 'V') || (ch[i] == 'K' && ch[i + 1] == 'K'))
                flag = true;
        }

        System.out.println(ans + (flag ? 1 : 0));
    }

    static final Random random = new Random();

    static void sort(int[] a) {
        int n = a.length;
        for (int i = 0; i < n; i++) {
            int val = random.nextInt(n);
            int cur = a[i];
            a[i] = a[val];
            a[val] = cur;
        }
        Arrays.sort(a);
    }

    static void sortl(long[] a) {
        int n = a.length;
        for (int i = 0; i < n; i++) {
            int val = random.nextInt(n);
            long cur = a[i];
            a[i] = a[val];
            a[val] = cur;
        }
        Arrays.sort(a);
    }

    static class FastScanner {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }

}

import java.util.*;
import java.util.Map.Entry;

public class Codechef
{
	public static void main (String[] args)
	{
		Scanner sc = new Scanner(System.in);
        String str = sc.next();

        char[] ch = str.toCharArray();
        int count=0,temp=1;

        for(int i=0;i<ch.length-1;i++){
        	if(ch[i]=='V' && ch[i+1]=='K'){
        		count++;
        		ch[i]=' ';
        		ch[i+1]=' ';
        		i++;
        	}
        }
        for(int i=0;i<ch.length-1;i++){
        	if(temp==1){
        		if((ch[i]=='V' && ch[i+1]=='V') || (ch[i]=='K' && ch[i+1]=='K')){
        			count++;
        			break;
        		}
        	}

        }

        System.out.println(count);

	}

}

import java.util.Scanner;

public class R409A {

	public void solve() {
		Scanner sc = new Scanner(System.in);

		String s = sc.nextLine();

		int cnt = 0;

		for (int i=0; i<s.length()-1; i++) {
			if (s.charAt(i) == 'V' && s.charAt(i+1) == 'K') {
				s = s.replace("VK", "OO");
				// cnt++;
			}
		}
		boolean[] used = new boolean[s.length()];
		for (int i=0; i<s.length()-1; i++) {
			if (s.charAt(i) == 'O' && s.charAt(i+1) == 'O'
					&& used[i] != true && used[i+1] != true) {
				cnt++;
				used[i] = true;
				used[i+1] = true;
			}
		}

		for (int i=0; i<s.length()-1; i++) {
			if (s.charAt(i) == 'V' && s.charAt(i+1) == 'V') {
				cnt++;
				break;
			}
			if (s.charAt(i) == 'K' && s.charAt(i+1) == 'K') {
				cnt++;
				break;
			}

		}

		System.out.println(cnt);

		/*

		if (cnt > 0) {
			if (s.length() > cnt*2) {
				int x = s.length() - cnt*2;

				if (x%2==0) {
					cnt++;
				}
			}

		}

		if (cnt == 0) {
			if (s.length() >= 2) {
				cnt++;
			}
		}

		System.out.println(cnt);*/
	}

	public static void main(String[] args) {
		new R409A().solve();
	}
}

import java.util.*;

public class AA {

    static Scanner in = new Scanner(System.in);
    static String S;

    public static void main(String[] args) {
        S = in.next();
        String aux = "";
        int max = OccVK(), inter;
        if (S.length() == 1) {
            System.out.println("0");
        } else {
            for (int i = 0; i < S.length(); i++) {
                aux = S;
                if (aux.charAt(i) == 'V') {
                    aux = aux.substring(0, i) + "K" + aux.substring(i + 1);
                    inter = OccVK(aux);
                    max = (inter > max) ? inter : max;
                }else{
                    aux = aux.substring(0, i) + "V" + aux.substring(i + 1);
                    inter = OccVK(aux);
                    max = (inter > max) ? inter : max;
                }
            }
            System.out.println(max);
        }
    }

    static int OccVK() {
        String aux = S;
        int count = 0, i = 0, j = 1;
        while (j < S.length() ) {
            if (S.charAt(i) == 'V' && S.charAt(j) == 'K') {
                count++;
            }
            i++;
            j++;
        }
        return count;
    }

    static int OccVK(String aux) {
        int count = 0, i = 0, j = 1;
        while (j < aux.length()) {
            if (aux.charAt(i) == 'V' && aux.charAt(j) == 'K') {
                count++;
            }
            i++;
            j++;
        }
        return count;
    }
}

import java.util.*;
import java.io.*;
import java.math.*;

public class A {
	public static void main(String... args) throws IOException {
		Scanner input = new Scanner(System.in);
		String line = input.next();

		int answer = 0;
		while (line.contains("VK")) {
			line = line.replaceFirst("VK", "XX");
			answer++;
		}

		System.out.print(line.contains("VV") || line.contains("KK") ? answer + 1 : answer);
	}
}

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

/**
 *
 * @author user
 */
public class JavaApplication67 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner in =new Scanner(System.in);
     int max=0;
    String str=in.next();
    int count=0;
    for(int i=0;i+1<str.length();i++){
        if(str.substring(i, i+2).equals("VK")){
            count++;
    i++;
        }
    }
    if(count>max)
        max=count;

    for(int i=0;i<str.length();i++){
        String s="";
        count =0;
        s+=str.substring(0, i);
        if(str.charAt(i)=='V')
        s+='K';
                else
            s+='V';
        s+=str.substring(i+1);
        for(int j=0;j+1<s.length();j++){
            if(s.substring(j, j+2).equals("VK")){
                count++;
                j++;
            }
        }
        if(count>max)
            max=count;

    }

        System.out.println(max);
    }

}

import java.util.Scanner;

public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        String in = sc.nextLine();

        int length = in.length();

        int max = occurance(new StringBuilder(in));

        for(int i = 0; i < length; i++) {
            char replace = 'K';

            if(in.charAt(i) == 'K')
                replace = 'V';

            StringBuilder temp = new StringBuilder(in);
            temp.setCharAt(i, replace);

            int result = occurance(temp);

            if(result > max)
                max = result;
        }

        System.out.println(max);
    }

    public static int occurance(StringBuilder z) {
        int count = 0;

        int a = z.indexOf("VK");

        while(a != -1) {
            count++;
            z.setCharAt(a, ' ');
            z.setCharAt(a + 1, ' ');
            a = z.indexOf("VK");
        }

        return count;
    }
}

//package cdr;
import java.util.*;
import java.math.*;
import java.io.*;

public class Luck{
	public static InputReader sc;
    public static PrintWriter out;
    public static final int MOD = (int) (1e9 + 7);
    public static void main(String[] args){
    	sc=new InputReader(System.in);
    	out=new PrintWriter(System.out);
    	String str=sc.readString();
    	int count1=0;
    	TreeSet<Integer> chngK=new TreeSet<Integer>();
    	TreeSet<Integer> chngV=new TreeSet<Integer>();
    	TreeSet<Integer> vk=new TreeSet<Integer>();
    	for(int i=0;i<str.length()-1;i++){
    		if(str.charAt(i)=='V' && str.charAt(i+1)=='K'){
    			vk.add(i);
    			count1+=1;
    		}
    		else if(str.charAt(i)=='K' && str.charAt(i+1)=='K'){
    			chngK.add(i);
    		}
    		else if(str.charAt(i)=='V' && str.charAt(i+1)=='V'){
    			chngV.add(i);
    		}
    	}
    	if(count1*2==str.length()){
    		out.println(count1);
    	}
    	else{
    		int max=count1;
    		if(chngK.size()>0){
    			int flag=0;
    			for(int i:chngK){
    				if(!vk.contains(i-1)){
    					flag=1;
    					break;
    				}
    			}
    			if(flag==1)
    			max=Math.max(max, count1+1);
    		}
    		if(chngV.size()>0){
    			int flag=0;
    			for(int i:chngV){
    				if(!vk.contains(i+1)){
    					flag=1;
    					break;
    				}
    			}
    			if(flag==1){
    				max=Math.max(max, count1+1);
    			}
    		}
    		out.println(max);
    	}
       	out.close();
    }

    static int gcd(int a,int b){
    	if(b==0){
    		return a;
    	}
    	return gcd(b,a%b);

    }
    static int lcm(int a,int b){
    	int g;
    	if(a<b){
    		g=gcd(b,a);
    	}
    	else{
    		g=gcd(a,b);
    	}
    	return (a*b)/g;
    }

    static boolean isPrime(int n){
    	 if (n == 2)
    	        return true;
    	    for (long i = 2; i * i <= n; i++) {
    	        if (n % i == 0)
    	            return false;
    	    }
    	    return true;
    }

    static void shuffle(int[] A){
    	for(int i=A.length-1;i>0;i--){
    		int j=(int)(Math.random()*(i+1));
    		int temp=A[j];
    		A[j]=A[i];
    		A[i]=temp;
    	}
    }

	public static class Node implements Comparable<Node>{
	    int v;
	    int d;
	    public Node(){
	    	;
	    }
	    public Node (int v, int d) {
	    	this.d = d;
	        this.v = v;

	    }

	    public void print() {
	        out.println(v + " " + d + " ");
	    }

	    public int compareTo(Node n1){
	    	return this.d-n1.d;
	    }
	}

	public static BigInteger pow(BigInteger base, BigInteger exp) {
	    if(exp.equals(new BigInteger(String.valueOf(0)))){
	        return new BigInteger(String.valueOf(1));
	    }
	    if(exp.equals(new BigInteger(String.valueOf(1))))
	        return base;
	    BigInteger temp=exp.divide(new BigInteger(String.valueOf(2)));
	    BigInteger val = pow(base, temp);
	    BigInteger result = val.multiply(val);
	    result=result.remainder(new BigInteger(String.valueOf(MOD)));
	    BigInteger AND=exp.and(new BigInteger(String.valueOf(1)));
	    if(AND.equals(new BigInteger(String.valueOf(1)))){
	        result = result.multiply(base);
	        result=result.remainder(new BigInteger(String.valueOf(MOD)));
	    }
	    return result;
	}

	static class InputReader {

	    private InputStream stream;
	    private byte[] buf = new byte[8192];
	    private int curChar, snumChars;
	    private SpaceCharFilter filter;

	    public InputReader(InputStream stream) {
	        this.stream = stream;
	    }

	    public int snext() {
	        if (snumChars == -1)
	            throw new InputMismatchException();
	        if (curChar >= snumChars) {
	            curChar = 0;
	            try {
	                snumChars = stream.read(buf);
	            } catch (IOException e) {
	                throw new InputMismatchException();
	            }
	            if (snumChars <= 0)
	                return -1;
	        }
	        return buf[curChar++];
	    }

	    public int nextInt() {
	        int c = snext();
	        while (isSpaceChar(c))
	            c = snext();
	        int sgn = 1;
	        if (c == '-') {
	            sgn = -1;
	            c = snext();
	        }
	        int res = 0;
	        do {
	            if (c < '0' || c > '9')
	                throw new InputMismatchException();
	            res *= 10;
	            res += c - '0';
	            c = snext();
	        } while (!isSpaceChar(c));
	        return res * sgn;
	    }

	    public long nextLong() {
	        int c = snext();
	        while (isSpaceChar(c))
	            c = snext();
	        int sgn = 1;
	        if (c == '-') {
	            sgn = -1;
	            c = snext();
	        }
	        long res = 0;
	        do {
	            if (c < '0' || c > '9')
	                throw new InputMismatchException();
	            res *= 10;
	            res += c - '0';
	            c = snext();
	        } while (!isSpaceChar(c));
	        return res * sgn;
	    }

	    public int[] nextIntArray(int n) {
	        int a[] = new int[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextInt();
	        return a;
	    }

	    public String readString() {
	        int c = snext();
	        while (isSpaceChar(c))
	            c = snext();
	        StringBuilder res = new StringBuilder();
	        do {
	            res.appendCodePoint(c);
	            c = snext();
	        } while (!isSpaceChar(c));
	        return res.toString();
	    }

	    public boolean isSpaceChar(int c) {
	        if (filter != null)
	            return filter.isSpaceChar(c);
	        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	    }

	    public interface SpaceCharFilter {
	        public boolean isSpaceChar(int ch);
	    }
	}

}

import java.util.Scanner;

public class Contest {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String c = sc.next();
        StringBuilder s = new StringBuilder(c);
        boolean f = true;
        int num = 0;

        for (int i = 0; i < s.length() - 1; i++) {
            if (s.charAt(i) == 'V' && s.charAt(i + 1) == 'K') {
                num++; i++;
            } else if (f) {
                if (s.charAt(i) == s.charAt(i + 1)) {
                    if (i + 2 < s.length() && s.charAt(i + 1) == 'V' && s.charAt(i + 2) == 'K');
                    else {
                        if (s.charAt(i + 1) == 'V') {
                            s.setCharAt(i+1, 'K');
                        }
                        else if (s.charAt(i + 1) == 'K') {
                            s.setCharAt(i, 'V');
                        }
                        num++;
                        f = false;
                    }
                }
            }
        }
        System.out.println(num);

    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.*;
import java.lang.*;
import java.applet.*;
public class Main {

    public static void main(String[] args) {
        Scanner sc= new Scanner (System.in);
        String a=sc.next();

        int num=0;
        while(a.contains("VK"))
        {
            a=a.replaceFirst("VK","I");
            num++;
        }
        if(a.contains("VV")||a.contains("KK"))
            num++;
        System.out.println(num);

    }
}

import java.util.*;
public class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int c =0,ans=0;
		for(int i=0;i<s.length();i++)
		{
			if(i>0)
			{
			if(s.charAt(i-1)=='V' && s.charAt(i)=='K') {ans++; i++;}
			if(i==s.length()) break;
			if((i+1)!=s.length()) if(s.charAt(i-1)=='V' && s.charAt(i)=='V' && s.charAt(i+1)!='K' && c==0) { c++; ans++; i++;}
			if((i+1)==s.length()) if(s.charAt(i-1)=='V' && s.charAt(i)=='V' && c==0) { c++; ans++; i++;}
			if(i==s.length()) break;
			if((i-2)>=0)if(s.charAt(i-1)=='K' && s.charAt(i)=='K' && s.charAt(i-2)!='V' && c==0) { c++; ans++; i++;}
			if((i-2)<0)if(s.charAt(i-1)=='K' && s.charAt(i)=='K' && c==0) { c++; ans++; i++;}
			if(i==s.length()) break;
			}
		}
		System.out.println(ans);
	}
}

import com.sun.source.tree.Tree;

import javax.xml.crypto.Data;
import java.io.*;
import java.util.*;
public class Main {
    final static long mod = 1000000007;

    static void debug(Object...args)
    {
        System.out.println(Arrays.deepToString(args));
    }
    public static void main(String[] args) throws Exception {
        InputReader sc = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        Random gen = new Random();
        int test = 1;//sc.nextInt();
        while(test --> 0) {

            String s = sc.nextLine();

            int res = s.length();
            String k = s.replace("VK", "");
            res = (res - k.length()) / 2;
            s = s.replace("VK", "1");
            if (s.contains("VV") || s.contains("KK")) res++;
            System.out.println(res);

        }
        pw.flush();
        pw.close();

    }

    static class Data implements Comparable<Data>{
        int x;
        int y;

        public Data (int m, int n) {
            x = m;
            y = n;
        }
        @Override
        public int compareTo(Data o) {
            return x - o.x;
        }
    }

    static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;

        public InputReader(InputStream st) {
            this.stream = st;
        }

        public int read() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int [] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }
        public long[] nextLongArray(int n) {
            long [] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextLong();
            }
            return a;
        }

        public static int[] shuffle(int[] a, Random gen)
        { for(int i = 0, n = a.length;i < n;i++)
        { int ind = gen.nextInt(n-i)+i;
            int d = a[i];
            a[i] = a[ind];
            a[ind] = d;

        }
            return a;
        }
        public static char[] shuffle(char[] a, Random gen)
        { for(int i = 0, n = a.length;i < n;i++)
        { int ind = gen.nextInt(n-i)+i;
            char d = a[i];
            a[i] = a[ind];
            a[ind] = d;

        }
            return a;
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

    }

}

import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class ViciousKeyboard {
	public static void main(String[] args) {
		out = new PrintWriter(new BufferedOutputStream(System.out));
		Reader in = new Reader();
		String s = in.read();
		if(s.length() == 1) out.println(0);
		else if(s.length() == 2) {
			if(s.equals("KV")) out.println(0);
			else out.println(1);
		}
		else{
			char[] a = s.toCharArray();
			StringBuilder sb = new StringBuilder(s);
			int count = 0, len = a.length - 1;
			for(int i = 0; i < len; i++){
				if(a[i] == 'K') continue;
				else if(a[i] == 'V' && a[i + 1] == 'K') {
					count++;
					sb.setCharAt(i, 'A');
					sb.setCharAt(i + 1, 'A');
				}
			}
			if(sb.indexOf("VV") != -1 || sb.indexOf("KK") != -1) count++;
			out.println(count);
		}
		in.close();
		out.close();
	}
	static PrintWriter out;
	static class Reader {
		BufferedReader br;
		StringTokenizer st;
		public Reader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		String read() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		int readInt() {
			return Integer.parseInt(read());
		}
		long readLong() {
			return Long.parseLong(read());
		}
		double readDouble() {
			return Double.parseDouble(read());
		}
		char readChar() {
			return read().charAt(0);
		}
		int[] readIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = readInt();
			return a;
		}
		long[] readLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = readLong();
			return a;
		}
		double[] readDoubleArray(int n) {
			double[] a = new double[n];
			for (int i = 0; i < n; i++)
				a[i] = readDouble();
			return a;
		}
		String[] readStringArray(int n) {
			String[] s = new String[n];
			for (int i = 0; i < n; i++)
				s[i] = read();
			return s;
		}
		char[] readCharArray(int n) {
			char[] ch = new char[n];
			for (int i = 0; i < n; i++)
				ch[i] = readChar();
			return ch;
		}
		String readLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
		void close() {
			try {
				br.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.PrintStream;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Eesaa
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            Scanner sc = new Scanner(System.in);
            String inputStr = sc.next();
            String tempStr = inputStr.replace("VK", "");
            String temp = inputStr.replaceAll("VK", " ");
            int count = (inputStr.length() - tempStr.length()) / 2;
            if (temp.contains("VV") || temp.contains("KK")) {
                count++;
            }
            System.out.println(count);
        }

    }
}

import java.util.*;

public class Main {

    public static void main(String[] args) {
        //1: Declare and initialize variables
        Scanner in = new Scanner(System.in);
        String x = in.next();
        ArrayList<Integer> VKloc = new ArrayList();

        for (int i = 0; i < x.length() - 1;) {
            if (x.substring(i, i + 2).equals("VK")) {
                VKloc.add(i);
                i += 2;
            } else {
                i++;
            }
        }

        String[] lol=x.split("VK");

        for (int i = 0; i < lol.length; i++) {
            if (lol[i].length()>1 && !lol[i].equals("KV")) {
                System.out.println(VKloc.size()+1);
                System.exit(0);
            }
        }
        System.out.println(VKloc.size());
    }
}

import java.io.*;
import java.util.Scanner;

public class Solution {

    public static void main(String[] args) throws IOException {
        //BufferedReader in = new BufferedReader(new FileReader(new File("input.txt")));
        BufferedWriter out = new BufferedWriter(new FileWriter(new File("output.txt")));
        Scanner in = new Scanner(System.in);
        //BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        //PrintWriter pw = new PrintWriter(System.out, true);

        StringBuilder s = new StringBuilder(in.nextLine());
        int c = 0;
        if(s.length() < 2){
            System.out.println("0");
            System.exit(0);
        }
        while (s.indexOf("VK") > -1){
            s.replace(s.indexOf("VK"),s.indexOf("VK") + 2, "--");
            c++;
        }
        if(s.indexOf("KK") > -1){
            c++;
        }else if(s.indexOf("VV") > -1){
            c++;
        }
        System.out.println(c);
        in.close();
        out.close();
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            char[] c = in.next().toCharArray();
            int cnt = 0;
            for (int j = 0; j < c.length - 1; j++) {
                if (c[j] == 'V' && c[j + 1] == 'K') cnt++;
            }
            int change = 0;
            for (int i = 0; i < c.length; i++) {
                int cur = 0;
                if (c[i] == 'V') c[i] = 'K';
                else c[i] = 'V';
                for (int j = 0; j < c.length - 1; j++) {
                    if (c[j] == 'V' && c[j + 1] == 'K') cur++;
                }
                if (c[i] == 'V') c[i] = 'K';
                else c[i] = 'V';
                cnt = Math.max(cur, cnt);
            }
            out.println(cnt);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

    }
}

import java.util.*;

public class VK {

public static void main(String args[]){

        Scanner s = new Scanner(System.in);
         char c[] = s.next().toCharArray();
         int count = 0;
         boolean plus = false;

         for(int i= 0;i<c.length;i++){

              if(i+1<c.length) {
                  if (c[i] == 'K' && c[i + 1] == 'K') {
                      plus = true;
                      i++;
                  } else if (c[i] == 'V' && c[i + 1] == 'K') {
                      count++;
                      i++;
                  }
                  else if(i+2<c.length && (c[i] == 'V' && c[i + 1] == 'V' && c[i + 2] == 'V' )){
                      plus = true;
                      i = i+1;
                  }
                  else if(i+2 == c.length && (c[i] == 'V' && c[i + 1] == 'V') ){
                      plus = true;
                      i++;
                  }

              }
         }

         if(plus){
             count++;
         }

         System.out.println(count);

        }

        }

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.*;

public class Main {
    public static void main(String arg[]) {
        InputReader in = new InputReader(System.in);
        OutputWriter out = new OutputWriter(System.out);
        int count = 0;
        int c = 0;
        String s = in.readString();
        for(int i = 0; i < s.length()-1; i++){
            if(s.charAt(i) == 'V' && s.charAt(i+1) == 'K'){
                count++;
                i++;
            }
            else if((s.charAt(i) == 'V' && s.charAt(i+1) == 'V') && (c != 1)){
                c = 1;
                if(i+2 < s.length() &&  s.charAt(i+2) == 'K'){
                    c = 0;
                }
            }
            else if((s.charAt(i) == 'K' && s.charAt(i+1) == 'K')&& (c != 1)){
                c = 1;
                if(i-1 >= 0 && s.charAt(i-1) == 'V'){
                    c = 0;
                }
            }

        }
        out.printLine(c+count);
        out.flush();
        out.close();
    }
}
class Node implements Comparable<Node>{
    int val;
    int c;
    HashSet<Integer> color;
    ArrayList<Integer> ar;
    int degree;
    Node(int i){
        this.val = i;
        color = new HashSet<Integer>();
        ar = new ArrayList<Integer>();
    }
    @Override
    public int compareTo(Node arg0) {
        // TODO Auto-generated method stub
        return Integer.compare(arg0.ar.size(), this.ar.size());
    }

}
class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public String next() {
        return readString();
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

    public void flush() {
        writer.flush();
    }
}

class IOUtils {

    public static int[] readIntArray(InputReader in, int size) {
        int[] array = new int[size];
        for (int i = 0; i < size; i++)
            array[i] = in.readInt();
        return array;
    }

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.ArrayList ;
import java.util.Collections ;
import java.util.Date;
import java.util.HashMap;
import java.util.Map ;
import javafx.util.converter.IntegerStringConverter;
    public class Codeforces {
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
          FastReader console = new FastReader () ;
          String x = console.next() ;
          int countv = 0 ;
          int countk = 0 ;
          int countt = 0 ;
          x=x.replaceAll("VK", "o") ;
          for (int i=0 ; i<x.length() ; i++)
          {
           if (x.charAt(i)=='V')
           {
               countk = 0 ;
               countv++ ;
               if (countv>1)
               {
                   countt ++ ;
                   break ;
               }
           }
           else if (x.charAt(i)=='K')
           {
               countv = 0 ;
                countk ++;
                if (countk>1)
                {
                    countt ++ ;
                    break ;
                }
           }
           else
           {
               countv = 0 ;
               countk = 0 ;
           }
          }
          for (int i=0 ; i<x.length() ; i++)
          {
              if (x.charAt(i)=='o')
              {
                  countt ++ ;
              }
          }
          System.out.println(countt);
    }
 }
class FastReader {
    BufferedReader br;
    StringTokenizer st;

    public FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    String nextLine() {
        String str = "";
        try {
            str = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }
}

import java.util.*;
public class As {

public static int ViciousKeyboard(String s){
	boolean flag=false;
	int count=0;
	for(int i=0;i<s.length()-1;i++){
		if(s.charAt(i)=='V'&&s.charAt(i+1)=='K'){
			count++;
			i++;
		}
		else if(s.length()<=2){
			if(s.charAt(i)=='V'&&s.charAt(i+1)=='V')
				flag=true;
			if(s.charAt(i)=='K'&&s.charAt(i+1)=='K')
				flag=true;
		}
		else if(s.length()>2){
			if(s.charAt(i)=='K'&&s.charAt(i+1)=='K')
				flag=true;
			if(s.charAt(i)=='V'&&s.charAt(i+1)=='V'){
				if(s.length()-1-i<2){
					flag=true;
					}
				else if(s.charAt(i+2)!='K'){
							flag=true;
							}

					}
		}
	}
	if(flag==true){
		count++;
	}
	return count;

}
public static void main(String[]args){
	Scanner sc=new Scanner(System.in);
	String in=sc.nextLine();
	int res=ViciousKeyboard(in);
	System.out.println(res);

}
}

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.List;

public class MContest {
	private static int sNext;
	private static final int EOF = -1;
	private static InputStream sInput = System.in;
	private static final String LINE_SEPARATOR = System.getProperty("line.separator");
	private static BufferedWriter sOutput = new BufferedWriter(new OutputStreamWriter(System.out));

	public MContest() throws Exception {
		sNext = sInput.read();
		solve();
		sInput.close();
		sOutput.close();
	}

	public static void main(String[] args) {
		try {
			new MContest();
		} catch (Exception e) {
			try {
				sInput.close();
				sOutput.close();
			} catch (IOException ioe) {
				ioe.printStackTrace();
			}
			e.printStackTrace();
		}
	}

	private boolean digit(int cp) {
		return cp >= '0' && cp <= '9';
	}

	private boolean whitespace(int cp) {
		return cp == ' ' || cp == '\t' || cp == '\r' || cp == '\n';
	}

	private boolean lineSeparator(int cp) {
		return cp == '\n' || cp == '\r';
	}

	private boolean wordSeparator(int cp) {
		return cp == ' ' || cp == '\t';
	}

	private Integer ni() throws IOException {
		while (whitespace(sNext)) sNext = sInput.read();
		int num = 0, sign = (sNext == '-') ? '-' : '+';
		if (sign == '-') sNext = sInput.read();
		if (!digit(sNext)) return null;
		while (true) {
			num = (num << 1) + (num << 3) + sNext - '0';
			if (!digit(sNext = sInput.read())) break;
		}
		return (sign == '-') ? -num : num;
	}

	private int[] nis() throws IOException {
		while (whitespace(sNext)) sNext = sInput.read();
		List<Integer> list = new ArrayList<>();
		while (!lineSeparator(sNext)) {
			Integer num = ni();
			if (num == null) break;
			list.add(num);
			while (wordSeparator(sNext)) sNext = sInput.read();
		}
		int n = list.size();
		if (n < 1) return null;
		int a[] = new int[n];
		for (int i = 0; i < n; ++i)
			a[i] = list.get(i);
		return a;
	}

	private int[] nis(int n) throws IOException {
		int a[] = new int[n];
		for (int i = 0; i < n; ++i)
			a[i] = ni();
		return a;
	}

	private int[][] nis(int r, int c) throws IOException {
		int a[][] = new int[r][c];
		for (int i = 0; i < r; ++i)
			a[i] = nis(c);
		return a;
	}

	private Long nl() throws IOException {
		while (whitespace(sNext)) sNext = sInput.read();
		long num = 0, sign = (sNext == '-') ? '-' : '+';
		if (sign == '-') sNext = sInput.read();
		if (!digit(sNext)) return null;
		while (true) {
			num = (num << 1) + (num << 3) + sNext - '0';
			if (!digit(sNext = sInput.read())) break;
		}
		return (sign == '-') ? -num : num;
	}

	private long[] nls() throws IOException {
		while (whitespace(sNext)) sNext = sInput.read();
		List<Long> list = new ArrayList<>();
		while (!lineSeparator(sNext)) {
			Long num = nl();
			if (num == null) break;
			list.add(num);
			while (wordSeparator(sNext)) sNext = sInput.read();
		}
		int n = list.size();
		if (n < 1) return null;
		long a[] = new long[n];
		for (int i = 0; i < n; ++i)
			a[i] = list.get(i);
		return a;
	}

	private long[] nls(int n) throws IOException {
		long a[] = new long[n];
		for (int i = 0; i < n; ++i)
			a[i] = nl();
		return a;
	}

	private long[][] nls(int r, int c) throws IOException {
		long a[][] = new long[r][c];
		for (int i = 0; i < r; ++i)
			a[i] = nls(c);
		return a;
	}

	private Double nd() throws IOException {
		double first = ni(), second;
		if (sNext != '.') return first;
		int res = 0, cnt = 0;
		while (true) {
			if (!digit(sNext = sInput.read())) break;
			cnt++;
			res = (res << 1) + (res << 3) + sNext - '0';
		}
		second = res * StrictMath.pow(10, -cnt);
		return (first < 0.0) ? first - second : first + second;
	}

	private double[] nds() throws IOException {
		List<Double> list = new ArrayList<>();
		while (!lineSeparator(sNext)) {
			Double num = nd();
			if (num == null) break;
			list.add(num);
			while (wordSeparator(sNext)) sNext = sInput.read();
		}
		int n = list.size();
		if (n < 1) return null;
		double a[] = new double[n];
		for (int i = 0; i < n; ++i)
			a[i] = list.get(i);
		return a;
	}

	private double[] nds(int n) throws IOException {
		double a[] = new double[n];
		for (int i = 0; i < n; ++i)
			a[i] = nd();
		return a;
	}

	private double[][] nds(int r, int c) throws IOException {
		double a[][] = new double[r][c];
		for (int i = 0; i < r; ++i)
			a[i] = nds(c);
		return a;
	}

	private String ns() throws IOException {
		while (whitespace(sNext)) sNext = sInput.read();
		if (sNext == EOF) return null;
		StringBuilder sb = new StringBuilder();
		while (true) {
			sb.append((char) sNext);
			if ((sNext = sInput.read()) == EOF || whitespace(sNext)) break;
		}
		return sb.toString();
	}

	private String[] nss() throws IOException {
		List<String> list = new ArrayList<>();
		while (!lineSeparator(sNext)) {
			String str = ns();
			if (str == null) break;
			list.add(str);
			while (wordSeparator(sNext)) sNext = sInput.read();
		}
		int n = list.size();
		if (n < 1) return null;
		String a[] = new String[n];
		for (int i = 0; i < n; ++i)
			a[i] = list.get(i);
		return a;
	}

	private String[] nss(int n) throws IOException {
		String a[] = new String[n];
		for (int i = 0; i < n; ++i)
			a[i] = ns();
		return a;
	}

	private String[][] nss(int r, int c) throws IOException {
		String a[][] = new String[r][c];
		for (int i = 0; i < r; ++i)
			a[i] = nss(c);
		return a;
	}

	private StringBuilder line() throws IOException {
		while (whitespace(sNext)) sNext = sInput.read();
		if (sNext == EOF) return null;
		StringBuilder sb = new StringBuilder();
		while (true) {
			sb.append((char) sNext);
			if ((sNext = sInput.read()) == EOF || lineSeparator(sNext)) break;
		}
		return sb;
	}

	private char[] ncs(int n) throws IOException {
		while (whitespace(sNext)) sNext = sInput.read();
		char a[] = new char[n];
		for (int i = 0; i < n; ++i) {
			a[i] = (char) sNext;
			sNext = sInput.read();
		}
		return a;
	}

	private char[][] ncs(int r, int c) throws IOException {
		char a[][] = new char[r][c];
		for (int i = 0; i < r; ++i)
			a[i] = ncs(c);
		return a;
	}

	private void print(char[] cbuf) throws IOException {
		sOutput.write(cbuf, 0, cbuf.length);
	}

	private void println(char[] cbuf) throws IOException {
		sOutput.write(cbuf, 0, cbuf.length);
		sOutput.write(LINE_SEPARATOR);
	}

	private <T> void print(T obj) throws IOException {
		String s = obj + "";
		sOutput.write(s, 0, s.length());
	}

	private <T> void println(T obj) throws IOException {
		String s = obj + LINE_SEPARATOR;
		sOutput.write(s, 0, s.length());
	}

	private <T> void debug(T... args) {
		StringBuilder sb = new StringBuilder();
		try {
			if (args != null) for (T obj : args)
				sb.append(obj + "").append(LINE_SEPARATOR);
			println("\u001B[31m" + sb.toString() + "\u001B[0m");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	private void debug(String format, Object... args) {
		try {
			if (args != null) format = String.format(format, args);
			println("\u001B[31m" + format + "\u001B[0m");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	private void solve() throws IOException {
		char a[] = ns().toCharArray();
		int ans = 0;
		for (int i = 0; i < a.length; ++i)
			if (i > 0 && a[i] == 'K' && a[i - 1] == 'V') ++ans;
		boolean changed = false;
		for (int i = 0; i < a.length; ++i) {
			boolean before = i > 0 && a[i] == 'K' && a[i - 1] == 'V';
			boolean after = i + 1 < a.length && a[i] == 'V' && a[i + 1] == 'K';
			if (before || after) continue;
			if (!changed) {
				if (i > 0 && a[i] == 'V' && a[i - 1] == 'V') {
					changed = true;
					a[i] = 'K';
					++ans;
				} else if (i < a.length - 1 && a[i] == 'K' && a[i + 1] == 'K') {
					changed = true;
					a[i] = 'V';
					++ans;
				}
			}
		}
		println(ans);
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.io.BufferedReader;

public class fstclass {

	public static void main(String[] args) {
		InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        String s = in.next();
        int cnt = 0;
        boolean [] a = new boolean[1000];

        for(int i = 0; i < s.length(); i ++) {
        	char x = s.charAt(i);
        	if(x == 'K') {
        		if(i != 0 && s.charAt(i - 1) == 'V') {
        			cnt ++;
        			a[i] = a[i - 1] = true;
        			i ++;
        		}
        	}
        }
        for(int i = 1; i < s.length(); i ++) {
        	if(!a[i] && !a[i - 1] && (s.charAt(i - 1) == 'V' || s.charAt(i) == 'K')) {
        		cnt ++;
        		break;
        	}
        }
        System.out.print(cnt);
	}

	static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }

}

import java.util.*;
import java.text.*;

public class Main {

	public static void main(String[] Args) {
		Scanner in = new Scanner(System.in);

		String s = in.next();

		int count=0;
		if(s.length()==1) {
			System.out.println("0");
		}
		else {
			int n = s.length();
			int f=0;
			for(int i=0;i<n-1;i++) {
				if(s.charAt(i)=='V' && s.charAt(i+1)=='K') {
					count++;
				}
			}
			for(int i=0;i<n;i++) {
				StringBuilder ss = new StringBuilder(s);

				if(s.charAt(i)=='V') {
					ss.setCharAt(i,'K');
				}
				else {
					ss.setCharAt(i,'V');
				}

				int res=0;
				for(int j=0;j<n-1;j++) {
					if(ss.charAt(j)=='V' && ss.charAt(j+1)=='K') {
						res++;
					}
				}
				if(res>count) {
					f=1;
					break;
				}
			}
			if(f==1) {
				System.out.println(count+1);
			}
			else {
				System.out.println(count);
			}
		}
		in.close();
	}
}

/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
If I'm the sun, you're the moon
Because when I go up, you go down
*******************************
*/
import java.util.*;
import java.io.*;

   public class Macro
   {
      public static void main(String args[]) throws Exception
      {
         //BufferedReader infile = new BufferedReader(new FileReader("cowdate.in"));
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));
         StringTokenizer st = new StringTokenizer(infile.readLine());
         String input = st.nextToken();
         int N = input.length();
         if(N == 1)
         {
             System.out.println(0);
             return;
         }
         char[] arr = input.toCharArray();
         int res = 0;
         for(int i=0; i < N-1; i++)
            if(arr[i] == 'V' && arr[i+1] == 'K')
                res++;
        boolean yee = false;
         for(int i=0; i < N-2; i++)
             if(arr[i] == arr[i+1] && arr[i] == arr[i+2])
                yee = true;
        if(arr[0] == arr[1] && arr[0] == 'K')
            yee = true;
        if(arr[N-1] == arr[N-2] && arr[N-1] == 'V')
            yee = true;
        if(yee)
            res++;
        System.out.println(res);
      }
}

import java.util.Scanner;

public class ViciousKeyboard {
	public static void main(String [] args){
		Scanner sc = new Scanner(System.in);
		String Test = sc.next();
		sc.close();
		boolean [] x = new boolean [Test.length()] ;
		for(int i = 0 ; i < Test.length() ; i ++)
			x[i] = false ;
		int Counter = 0 ;
		boolean Possible1 = false ;
		for(int i = 0 ; i < Test.length()-1 ; i ++){
			if(Test.charAt(i) == 'V' && Test.charAt(i+1) =='K'){
				Counter ++ ;
				x[i]= true;
				x[i+1]= true;}
			}
		for(int i = 0 ; i < Test.length()-1 ; i ++){
			if(Test.charAt(i) == 'V' && Test.charAt(i+1) =='V' && x[i+1] != true){
				Possible1 = true;}
			if(Test.charAt(i) == 'K' && Test.charAt(i+1) =='K' && x[i] != true)	{
				Possible1 = true ;}}
		if(Possible1)
			Counter ++ ;
		System.out.println(Counter);
		}
}

import java.util.Scanner;
import java.util.StringTokenizer;

public class A2 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String  q = sc.nextLine();
		int m = count(q);
		//System.out.println("Best: "+m);
		for (int i = 0;i < q.length();i++){
			char[] v = q.toCharArray();
			switch(q.charAt(i)){
			case 'V':
				v[i] = 'K';
				m = Math.max(m, count(String.valueOf(v)));
				break;
			case 'K':
				v[i] = 'V';
				m = Math.max(m, count(String.valueOf(v)));
				break;
			}
			//String r = v.toString();
			//System.out.println("Best: "+m);

		}
		System.out.println(m);
	}
	public static int count(String str){
		String findStr = "VK";
		int lastIndex = 0;
		int count = 0;

		while(lastIndex != -1){

		    lastIndex = str.indexOf(findStr,lastIndex);

		    if(lastIndex != -1){
		        count ++;
		        lastIndex += findStr.length();
		    }
		}
		return count;
	}
}

import java.util.*;
public class Main
{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		int c=0;
		int index=0;
		for(int i=0;i<s.length();i++){
			char a=s.charAt(i);
			if(a=='V'){
			    if(i+1<s.length()){
		             if(s.charAt(i+1)=='K'){
						 c++;
						 s=s.substring(0,i)+s.substring(i+2,s.length());
						 i--;
					 }
				}
			}
		}
		if(s.contains("VV") || s.contains("KK")){
			c++;
		}
		System.out.println(c);
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Helloworld {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=br.readLine();
		int l=s.length();
		if(l==1) {
			System.out.println(0);
		}
		else if(l==2) {
			if(s.equals("KV")) {
				System.out.println(0);
			}
			else {
				System.out.println("1");
			}
		}
		else {
			int count=0;
			for(int i=0;i<l-1;i++) {
				if(s.substring(i,i+2).equals("VK")) {
					count++;
				}
			}
			if(s.contains("VVV") || s.contains("KKK")) {
				count++;
			}
			System.out.println(count);
		}
	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class A {

    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String s = br.readLine();
            boolean lastv = s.charAt(0) == 'V';
            int[] n = new int[100];
            int idx = 0;
            n[idx] = 1;
            int ans = 0;
            for (int i = 1; i < s.length(); ++i) {
                if ((lastv && s.charAt(i) != 'V') || (!lastv && s.charAt(i) == 'V')) {
                    idx++;
                }
                lastv = s.charAt(i) == 'V';
                n[idx]++;
                if (n[idx] > 2) {
                    ans = 1;
                }
            }
            ans += (idx + 1) / 2;
            if (s.charAt(0) != 'V') {
                ans--;
            }
            if (s.length() == 2) {
                ans = 1;
            }
            System.out.println(ans);
        } catch (IOException ex) {
        }
    }
}

import java.util.Scanner;
import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;
import static java.lang.Math.*;

public class Check2 implements Runnable{

	static class InputReader
	{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream)
		{
			this.stream = stream;
		}

		public int read()
		{
			if (numChars==-1)
				throw new InputMismatchException();

			if (curChar >= numChars)
			{
				curChar = 0;
				try
				{
					numChars = stream.read(buf);
				}
				catch (IOException e)
				{
					throw new InputMismatchException();
				}

				if(numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine()
		{
			BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
			String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
		}
		public int nextInt()
		{
			int c = read();

			while(isSpaceChar(c))
				c = read();

			int sgn = 1;

			if (c == '-')
			{
				sgn = -1;
				c = read();
			}

			int res = 0;
			do
			{
				if(c<'0'||c>'9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));

			return res * sgn;
		}

		public long nextLong()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			long res = 0;

			do
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));
				return res * sgn;
		}

		public double nextDouble()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.')
			{
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.')
			{
				c = read();
				double m = 1;
				while (!isSpaceChar(c))
				{
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}

		public String readString()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = read();
			}
			while (!isSpaceChar(c));

			return res.toString();
		}

		public boolean isSpaceChar(int c)
		{
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next()
		{
			return readString();
		}

		public interface SpaceCharFilter
		{
			public boolean isSpaceChar(int ch);
		}
	}
	static LinkedList <Integer> adj[];
 //   static int co=0,f=0;

    static void Check2(int n){
        adj=new LinkedList[n+1];
        for(int i=0;i<=n;i++){
            adj[i]=new LinkedList();
        }

    }
    static void add(int i,int j){
       // if(!adj[i].contains(j))
        adj[i].add(j);
   // if(!adj[j].contains(i))
        adj[j].add(i);

     //   adj[j].add(i);

    }
	  public static void main(String[] args) throws Exception {
    new Thread(null, new Check2(), "Check2", 1<<26).start();// to increse stack size in java
  }
  public void run(){
        /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
        //Scanner in=new Scanner(System.in);
    InputReader in=new InputReader(System.in);
		PrintWriter w=new PrintWriter(System.out);

 char c[]=in.next().toCharArray();

      int f=0;
      int n=c.length;
      int ans=0;
      for(int i=0;i<c.length-1;i++)
		{

          if(c[i]=='V'&&c[i+1]=='K'){
              ans++;
              i++;
          }

          else if(f==0){
          if(c[i]=='V'&&c[i+1]!='K'){
              c[i+1]='K';
              i++;
              ans++;
              f=1;
          }
         else if(c[i]=='K'&&c[i+1]=='K'){
              c[i]='V';
              ans++;
             i++;
              f=1;
          }

  //        w.println(i);
          }
      }

      w.println(ans);

        w.close();

    }

    static void dfs(int i,int v[]){
        if(v[i]==1){
            return ;
        }
        else{

            v[i]=1;
            Iterator <Integer>p=adj[i].iterator();
            while(p.hasNext()){
                 Integer ne=p.next();

              dfs(ne,v);
     //
       //        System.out.println(q+" "+i);
            //System.out.println(i+" "+max1+" "+max2);
            }

        }

    }
    static class node{

        int y;
        int val;

        node(int a,int b){

            y=a;
            val=b;

        }

    }

}

import java.util.Scanner;

/**
 *
 * @author Mahmoud
 */
public class Again {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String vk =sc.next();
        int index = 0, total = 0;

        if(vk.length() == 2 &&(vk.contains("VV") || vk.contains("KK")))
            total++;
        else
        {

        while(index < vk.length())
        {
            index = vk.indexOf("VK", index);

            if(index == -1)
                break;

            total++;
            index += 2;

        }
        }
          if(vk.contains("VVV") || vk.contains("KKK") || vk.indexOf("KK") == 0)
              total++ ;

        System.out.println(total);
        }

}

import java.util.*;
import java.util.Map.Entry;

public class Codechef
{
	public static void main (String[] args)
	{
		Scanner sc = new Scanner(System.in);
        String str = sc.next();

        char[] ch = str.toCharArray();
        int count=0;

        for(int i=0;i<ch.length-1;i++){
        	if(ch[i]=='V' && ch[i]=='K')
        		count++;
        }

        if(count==ch.length/2 || count==(ch.length/2-1)){
        	System.out.println(count);
        }
        else{
        	System.out.println(count+1);
        }
	}

}

import java.util.Scanner;

/**
 *
 * @author Mahmoud
 */
public class Again {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String vk =sc.next();
        int index = 0, total = 0;

        if(vk.length() == 2 &&(vk.contains("VV") || vk.contains("KK")))
            total++;
        else
        {

        while(index < vk.length())
        {
            index = vk.indexOf("VK", index);

            if(index == -1)
                break;

            total++;
            index += 2;

        }

          if(vk.contains("VVV") || vk.contains("KKK") || vk.indexOf("KK") == 0
|| vk.indexOf("KK") == vk.length() - 2 )
              total++ ;

        }
        System.out.println(total);
        }

}

/*
 * Author Ayub Subhaniya
 * Institute DA-IICT
 */

import java.io.*;
import java.math.*;
import java.util.*;

public class Codeforces408{

	InputStream in;
	PrintWriter out;

	void solve() {
		String s=ns();
		int ans=0;

		for (int i=1;i<s.length();i++)
		{
			if (s.charAt(i)=='V'&&s.charAt(i-1)=='V')
				{
					ans++;
					break;
				}
			if (s.charAt(i)=='K'&&s.charAt(i-1)=='K')
			{
				ans++;
				break;
			}
		}
		for (int i=1;i<s.length();i++)
		{
			if (s.charAt(i)=='K'&&s.charAt(i-1)=='V')
				ans++;
		}
		out.println(ans);
	}

	void run() throws Exception {
		String INPUT = "C:/Users/ayubs/Desktop/input.txt";
		//oj=true;
		in = oj ? System.in : new FileInputStream(INPUT);
		out = new PrintWriter(System.out);

			long s = System.currentTimeMillis();
			solve();
			out.flush();
			tr(System.currentTimeMillis() - s + "ms");

	}
	public static void main(String[] args) throws Exception {
		new Codeforces408().run();
	}

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte() {
		if (lenbuf == -1)
			throw new InputMismatchException();
		if (ptrbuf >= lenbuf) {
			ptrbuf = 0;
			try {
				lenbuf = in.read(inbuf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean inSpaceChar(int c) {
		return !(c >= 33 && c <= 126);
	}

	private int skip() {
		int b;
		while ((b = readByte()) != -1 && inSpaceChar(b))
			;
		return b;
	}

	private double nd() {
		return Double.parseDouble(ns());
	}

	private char nc() {
		return (char) skip();
	}

	private String ns() {
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!(inSpaceChar(b))) { // when nextLine, (inSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n) {
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while (p < n && !(inSpaceChar(b))) {
			buf[p++] = (char) b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m) {
		char[][] map = new char[n][];
		for (int i = 0; i < n; i++)
			map[i] = ns(m);
		return map;
	}

	private int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}

	private int ni() {
		int num = 0, b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl() {
		long num = 0;
		int b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;

	private void tr(Object... o) {
		if (!oj)
			System.out.println(Arrays.deepToString(o));
	}

}

import java.math.*;
import java.io.*;
import java.util.*;

public class Main{

    public static void main(String[] args ) throws IOException
    {
    	//BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	Scanner in = new Scanner(System.in);
    	String s = in.next();
    	char[] d = s.toCharArray();
    	int count = 0;
    	if(s.length() <=1)
    		System.out.println(0);
    	else
    	{
    		int n = d.length;
    		for(int i = 0; i < n - 1; i++)
    		{
    			if(d[i] == 'V' && d[i+1] == 'K')
    			{
    				i+=1;
    				continue;
    			}
    			if(d[i] == 'V' && d[i + 1] == 'V')
    			{
    				if(i + 2 < n && d[i + 2] == 'K')
    					i += 2;
    				else
    				{
    					d[i + 1] = 'K';
        				break;
    				}

    			}
    			if(d[i] == 'K' && d[i + 1] == 'K')
    			{
    				d[i] = 'V';
    				break;
    			}

    		}
    		for(int i = 0; i < n-1;i++)
    		{
    			if(d[i] == 'V' && d[i+1] == 'K')
    			{
    				count++;
    				i += 1;
    			}
    		}
    		System.out.println(count);
    	}
    }

}

import java.util.*;
import java.util.Map.Entry;

public class Codechef
{
	public static void main (String[] args)
	{
		Scanner sc = new Scanner(System.in);
        String str = sc.next();

        char[] ch = str.toCharArray();
        int count=0;

        for(int i=0;i<ch.length-1;i++){
        	if(ch[i]=='V' && ch[i+1]=='K')
        		count++;
        }

        if(count==ch.length/2){
        	System.out.println(count);
        }
        else{
        	System.out.println(count+1);
        }
	}

}

import java.io.*;
import java.util.*;
import java.math.*;

public class _409div2Q1
{
    public static void main(String[] args) throws IOException
    {
        FastScanner obj = new FastScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));
      	String str = obj.next();
      	int l = str.length();

      	if(l==1)
      		out.print(0);
		else if(l==2)
		{
			if(str.equals("KV"))
				out.print(0);
			else
				out.print(1);
		}
      	else
      	{
      		int ans = 0;
      		int flag = 0;
      		for(int i=0;i<l-1;i+=2)
      		{
      			if(str.charAt(i)=='V' && str.charAt(i+1)=='K')
      				ans++;
      			else if(flag==0)
      			{
      				if(str.charAt(i)=='K' && str.charAt(i+1)=='V')
      					continue;
      				else
      				{
      					ans++;
      					flag = 1;
      				}
      			}

      		}
      		out.print(ans);
      	}
        out.close();
   }

   //-----------PrintWriter for faster output---------------------------------
   public static PrintWriter out;

   //-----------FastScanner class for faster input----------
   public static class FastScanner {
        BufferedReader br;
        StringTokenizer tokenizer;

        public FastScanner() throws IOException {
            br = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = new StringTokenizer(br.readLine().trim());
        }

        String next() {
            while (tokenizer == null || !tokenizer.hasMoreElements()) {
                try {
                    tokenizer = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                    }
            }
          return tokenizer.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        int[] nextIntArray() throws IOException {
            String[] line = br.readLine().trim().split(" ");
            int[] out = new int[line.length];

            for (int i = 0; i < line.length; i++) {
                out[i] = Integer.valueOf(line[i]);
            }
            return out;
        }

        BigInteger nextBigInteger() throws IOException {
            return new BigInteger(next());
        }

        String nextLine(){
            String str = "";
	        try {
	            str = br.readLine();
	        } catch (IOException e) {
	            e.printStackTrace();
	        }
	        return str;
        }

   }
   //--------------------------------------------------------
}

import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class A801A2{
	public static void main(String args[]) throws IOException{
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
		/*int t = in.nextInt();
		for(int a0=0;a0<t;a0++){*/
			String s = in.next();
			int count2 = 0;
			int temp = 0;
			ArrayList<Integer> count = new ArrayList<Integer>();
			count.add(0);
			for(int i = 1;i<s.length();i++){
					if(s.charAt(i) != s.charAt(i-1) && (s.charAt(i)=='K' && s.charAt(i-1)=='V')){
						count2++;
					}
			}
			count.add(count2);
			ArrayList<Integer> h = new ArrayList<>();
			if(s.length() >1){
				for(int i0 = 0;i0<s.length();i0++){
					int count1=0;
					for(int i = 1;i<s.length();i++){
						if(s.charAt(i) != s.charAt(i-1) && (s.charAt(i)=='K' && s.charAt(i-1)=='V')){
							count1++;
						}
						else if(s.charAt(i) == s.charAt(i-1) && temp ==0 && !(h.contains(i-1))){
							h.add(i-1);
							count1++;
							temp++;
						}
					}
					count.add(count1);
				}

			}
			out.write(Collections.max(count)+"\n");
		//}
		out.flush();
	}

}

import static java.lang.Math.*;
import static java.util.Arrays.* ;

import java.util.*;
import java.io.*;

public class D
{

    void main() throws Exception
    {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        char [] s = sc.next().toCharArray() ;
        int ans = 0 ;
        for(int i = 0 ;i < s.length ; i++)
        {
            if(s[i] == 'V')
                s[i] = 'K' ;
            else if(s[i] == 'K')
                s[i] = 'V' ;
            int cnt = 0 ;
            for(int j = 0 ; j < s.length - 1; j ++)
                if(s[j] == 'V' && s[j + 1] == 'K')
                    cnt ++ ;
            ans = max(ans , cnt) ;

            if(s[i] == 'V')
                s[i] = 'K' ;
            else if(s[i] == 'K')
                s[i] = 'V' ;

        }
        out.println(ans);
        out.flush();
        out.close();
    }
    class Scanner
    {
        BufferedReader br;
        StringTokenizer st;

        Scanner(InputStream in)
        {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() throws Exception
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }
        String nextLine() throws Exception
        {
            return br.readLine() ;
        }
        int nextInt() throws Exception { return Integer.parseInt(next()); }

        long nextLong() throws Exception { return Long.parseLong(next()); }

        double nextDouble() throws Exception { return Double.parseDouble(next());}
    }

    public static void main (String [] args) throws Exception {(new D()).main();}

}

import java.util.Scanner;

/**
 *
 * @author Mohammad
 */
public class JavaApplication83 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
      Scanner in=new Scanner(System.in);
      String str=in.next();
      int c=1;
      int count=0;
      char[] arr=str.toCharArray();
      for(int i=0;i+1<arr.length;i++){
          if(arr[i]=='V'){
              if(arr[i+1]=='K')
                  count++;
              else{
                  if(c==1)
                      count++;
                  c--;
              }
          }
      }
        System.out.println(count);

    }

}

import java.util.Scanner;

/**
 *
 * @author Mahmoud
 */
public class Again {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String vk =sc.next();
        StringBuilder sb = new StringBuilder(vk);

        int index = 0, total = 0;
        while(index < sb.length())
        {

            index = sb.indexOf("VK", index);

            if(index == -1)
                break;

            total++;
            index += 2;

        }
       if(sb.indexOf("VVV") != -1 || sb.indexOf("KKK") != -1)
           total++;
        System.out.println(total);
}
}

import java.util.*;
public class viciouskeyboard {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner input = new Scanner(System.in);
		String s = input.next();
		int counter = 0;
		for(int i=0;i<s.length()-1;i++){

			 if(s.charAt(i) == 'V' && s.charAt(i+1) == 'V'){
				  if(i+2 == s.length() || s.charAt(i+2) == 'V'){
					  counter++;
					  break;
				  }
			 }
			 if(s.charAt(i) == 'K' && s.charAt(i+1) == 'K'){
				 if(i+2 == s.length() || s.charAt(i+2) == 'K'){counter++;
				 break;
				 }
			 }
			}
		for(int i=0; i<s.length()-1;i++){
			if(s.charAt(i) == 'V' && s.charAt(i+1) == 'K')counter++;

		}
		System.out.println(counter);

	}

}

import java.util.*;
public class Main {

    public static void main(String[] args) {
        Scanner ob= new Scanner(System.in);
        String s= ob.nextLine();
        int c=0, f=0;
        for(int i=0; i<s.length()-1; i++)
        {
            if(s.charAt(i)=='V' && s.charAt(i+1)=='K')
            {
                c++;

                i++;
            }
            else if(s.charAt(i)=='V' && s.charAt(i+1)=='V' && f==0 )
            {
                if(s.length()!=2)
                {
                    if((i+2)<s.length() && s.charAt(i+2)!='K')
                    {
                        c++; f++;
                    }

                }
                else
                {
                    c++;
                    f++;
                }
            }
            else if(s.charAt(i)=='K' && s.charAt(i+1)=='K' && f==0 )
            {
                if(s.length()!=2)
                {
                    if((i-1)>=0 && s.charAt(i-1)!='V')
                    {
                        c++; f++;
                    }

                }
                else
                {
                    c++;
                    f++;
                }
            }
        }

        System.out.println(c);

    }
}

import java.util.Scanner;
import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;
import static java.lang.Math.*;

public class Check2 implements Runnable{

	static class InputReader
	{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream)
		{
			this.stream = stream;
		}

		public int read()
		{
			if (numChars==-1)
				throw new InputMismatchException();

			if (curChar >= numChars)
			{
				curChar = 0;
				try
				{
					numChars = stream.read(buf);
				}
				catch (IOException e)
				{
					throw new InputMismatchException();
				}

				if(numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine()
		{
			BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
			String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
		}
		public int nextInt()
		{
			int c = read();

			while(isSpaceChar(c))
				c = read();

			int sgn = 1;

			if (c == '-')
			{
				sgn = -1;
				c = read();
			}

			int res = 0;
			do
			{
				if(c<'0'||c>'9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));

			return res * sgn;
		}

		public long nextLong()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			long res = 0;

			do
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));
				return res * sgn;
		}

		public double nextDouble()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.')
			{
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.')
			{
				c = read();
				double m = 1;
				while (!isSpaceChar(c))
				{
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}

		public String readString()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = read();
			}
			while (!isSpaceChar(c));

			return res.toString();
		}

		public boolean isSpaceChar(int c)
		{
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next()
		{
			return readString();
		}

		public interface SpaceCharFilter
		{
			public boolean isSpaceChar(int ch);
		}
	}
	static LinkedList <Integer> adj[];
 //   static int co=0,f=0;

    static void Check2(int n){
        adj=new LinkedList[n+1];
        for(int i=0;i<=n;i++){
            adj[i]=new LinkedList();
        }

    }
    static void add(int i,int j){
       // if(!adj[i].contains(j))
        adj[i].add(j);
   // if(!adj[j].contains(i))
        adj[j].add(i);

     //   adj[j].add(i);

    }
	  public static void main(String[] args) throws Exception {
    new Thread(null, new Check2(), "Check2", 1<<26).start();// to increse stack size in java
  }
  public void run(){
        /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
        //Scanner in=new Scanner(System.in);
    InputReader in=new InputReader(System.in);
		PrintWriter w=new PrintWriter(System.out);

 char c[]=in.next().toCharArray();

      int f=0;
      int n=c.length;
      int ans2=0;
      for(int i=0;i<c.length-1;)
		{
          if(c[i]=='V'&&c[i+1]=='K'){
              i=i+2;
          }
          else if(c[i]=='K'&&c[i+1]=='K'&&f==0){
              c[i]='V';
              i=i+2;
              f=1;
          }
          else if(c[i]=='V'&&c[i+1]=='V'&&f==0){
              c[i+1]='K';
              i=i+2;
              f=1;
          }
          else
              i++;

        //  w.println(i);
      }

      for(int i=0;i<c.length-1;)
      {

          if(c[i]=='V'&&c[i+1]=='K'){
              i=i+2;
              ans2++;
          }
          else{
              i=i+1;
          }

      }

      w.println(ans2);

        w.close();

    }

    static void dfs(int i,int v[]){
        if(v[i]==1){
            return ;
        }
        else{

            v[i]=1;
            Iterator <Integer>p=adj[i].iterator();
            while(p.hasNext()){
                 Integer ne=p.next();

              dfs(ne,v);
     //
       //        System.out.println(q+" "+i);
            //System.out.println(i+" "+max1+" "+max2);
            }

        }

    }
    static class node{

        int y;
        int val;

        node(int a,int b){

            y=a;
            val=b;

        }

    }

}

import java.util.*;
public class viciousKeyBoard
{
	public static void main(String[] args)
	{
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		int count=0;
		char ch[]=s.toCharArray();
		for(int i=0;i<ch.length-1;i++)
		{
			if(ch[i]=='V' && ch[i]==ch[i+1])
			{
				ch[i+1]='K';
				count++;
				break;
			}
		}

		if(count==0)
		{
			for(int i=s.length()-1;i>0;i--)
			{
				if(ch[i]=='K' && ch[i]==ch[i-1])
				{
					ch[i-1]='V';
					break;
				}
			}
		}
		count=0;
		for(int i=0;i<ch.length-1;i++)
		{
			if(ch[i]=='V' && ch[i+1]=='K')
			{
				count++;
			}
		}

		System.out.println(count);
	}
}

import java.io.*;
import java.util.StringTokenizer;

public class Main {

	public static FastScanner in = new FastScanner(System.in);
	public static PrintWriter pw = new PrintWriter(System.out);

	public static class FastScanner {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public FastScanner(InputStream i) {
			reader = new BufferedReader(new InputStreamReader(i));
			tokenizer = new StringTokenizer("");
		}

		public String next() throws IOException {
			while (!tokenizer.hasMoreTokens())
				tokenizer = new StringTokenizer(reader.readLine());
			return tokenizer.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public void close() throws IOException {
			reader.close();
		}
	}

	public static void main(String[] args) {
		try {
			String t = in.next();
			int nbVk = 0;
			int oneAdd = 0;
			for (int i = 0; i < t.length() - 1; i++) {
				if (t.charAt(i) == 'V' && t.charAt(i + 1) == 'K') {
					nbVk++;
					i++;
				} else if (oneAdd == 0 && t.charAt(i) == 'V' && t.charAt(i + 1) != 'K')
					oneAdd = 1;
			}
			System.out.println(nbVk + oneAdd);
			in.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class viciousKeyboard {

	public static void main(String[] args) throws IOException {

		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		String str = f.readLine();

		int c = 0;
		boolean add= false;

		if (str.length() == 1){

			c = 0;

		}else{

			for (int i = 0; i < str.length(); i++){
				if (i != str.length()-1 && str.charAt(i) == 'V' && str.charAt(i+1) == 'K'){
					c++;
				}
				if (i != str.length()-1 && i != 0 && str.charAt(i-1) == 'V' && str.charAt(i) == 'V' && str.charAt(i+1) == 'V'){
					add = true;
				}
				if (i == str.length()-1 && str.charAt(i-1) == 'V' && str.charAt(i) == 'V'){
					add = true;
				}
			}

			if (add){
				c++;
			}

		}

		System.out.print(c);
		System.out.close();

	}

}

import java.util.Scanner;
import java.util.regex.Pattern;

public class vicious_keyboard {
public static void main (String args[])
{
	Scanner s=new Scanner(System.in);

	String n=new String();
	n=s.nextLine();
    int count=0;
    int max=0;
    String temp=n;
    s.close();
    for (int j=0;j<n.length();j++)
    {

    	if (n.charAt(j)=='K') 	n=n.substring(0, j)+"V"+n.substring(j+1, temp.length());
    	else n=n.substring(0, j)+"K"+n.substring(j+1, temp.length());
for (int i=1;i<n.length();i++)
{
	if (n.charAt(i)=='K' && n.charAt(i-1)=='V')
		++count;
}
if (count>max) max=count;
n=temp;
count=0;
    }

System.out.println(max);

}
}

import java.io.*;
import java.util.*;
import java.math.*;

public class _409div2Q1
{
    public static void main(String[] args) throws IOException
    {
        FastScanner obj = new FastScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));
      	String str = obj.next();
      	int l = str.length();

      	if(l==1)
      		out.print(0);
		else if(l==2)
		{
			if(str.equals("KV"))
				out.print(0);
			else
				out.print(1);
		}
      	else
      	{
      		int ans = 0;
      		int flag = 0;
      		Set<Integer> st = new HashSet<Integer>();
      		for(int i=0;i<l-1;i++)
      		{
      			char c = str.charAt(i);
      			char c2 = str.charAt(i+1);
      			String s = "";
      			s += c;
      			s += c2;

      			if(s.equals("VK"))
      			{
      				ans++;
					st.add(i);
      			}
      		}
      		for(int i=0;i<l-1;i++)
      		{
      			if(st.contains(i))
      				continue;

      			char c = str.charAt(i);
      			char c2 = str.charAt(i+1);
      			String s = "";
      			s += c;
      			s += c2;

      			if(flag==0)
      			{
      				if(!s.equals("KV"))
      				{
      					ans++;
      					flag=1;
      					i++;
      				}
      			}

      		}
      		out.println(ans);
      	}
        out.close();
   }

   //-----------PrintWriter for faster output---------------------------------
   public static PrintWriter out;

   //-----------FastScanner class for faster input----------
   public static class FastScanner {
        BufferedReader br;
        StringTokenizer tokenizer;

        public FastScanner() throws IOException {
            br = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = new StringTokenizer(br.readLine().trim());
        }

        String next() {
            while (tokenizer == null || !tokenizer.hasMoreElements()) {
                try {
                    tokenizer = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                    }
            }
          return tokenizer.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        int[] nextIntArray() throws IOException {
            String[] line = br.readLine().trim().split(" ");
            int[] out = new int[line.length];

            for (int i = 0; i < line.length; i++) {
                out[i] = Integer.valueOf(line[i]);
            }
            return out;
        }

        BigInteger nextBigInteger() throws IOException {
            return new BigInteger(next());
        }

        String nextLine(){
            String str = "";
	        try {
	            str = br.readLine();
	        } catch (IOException e) {
	            e.printStackTrace();
	        }
	        return str;
        }

   }
   //--------------------------------------------------------
}

import java.io.*;
import java.util.StringTokenizer;

public class Codeforces_round_409_div_2_ViciousKeyboard {

    public static void main(String[] args) {
        FScanner input = new FScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out), true);
        String line = input.nextLine();
        int answer = 0;
        for (int i = 0; i < line.length(); i++) {
            StringBuilder builder = new StringBuilder(line);
            if (line.charAt(i) == 'K') {
                builder.setCharAt(i, 'V');
                answer = Math.max(answer, getNum(builder.toString()));
            } else {
                builder.setCharAt(i, 'K');
                answer = Math.max(answer, getNum(builder.toString()));
            }
        }
        out.println(answer);
        out.close();
    }

    public static int getNum(String line) {
        int answer = 0;
        StringBuilder current = new StringBuilder();
        for (int i = 0; i < line.length(); i++) {
            if (current.length() >= 2) {
                current = current.deleteCharAt(0);
            }
            current = current.append(line.charAt(i));
            if (current.length() == 2 && current.toString().equals("VK")) {
                answer++;
            }
        }
        return answer;
    }

    public static PrintWriter out;

    public static class FScanner {
        BufferedReader br;
        StringTokenizer st;

        public FScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        private String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
}

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class VK{
	public static void main(String[] args)throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String s=br.readLine();
		int l=s.length();
		if(l<=1){
			System.out.println(0);
			return;
		}

		String sto[]=new String[l];
		int count=0,flag=0;
		for (int i=0;i<l-1;i++) {
			sto[i]=s.substring(i,i+2);
		}
		if(sto[0].equals("KK")){
				sto[0]="VK";
				flag=1;
		}

		if(l==2 && sto[0].equals("VV"))
			sto[0]="VK";
		for (int i=1;i<l-2; i++) {
			if(flag==0)
				if(!sto[i-1].equals("VK") && (sto[i].equals("VV") || sto[i].equals("KK")) && !sto[i+1].equals("VK")){
					sto[i]="VK";
					flag=1;
				}
			/*if(sto[i].equals("VK")){
				System.out.println(sto[i]);
				count++;
			}*/
		}
		if(flag==0 && sto[l-2].equals("VV"))
			sto[l-2]="VK";
		if(flag==0 && sto[l-2].equals("KK") && !sto[l-3].equals("VK"))
			sto[l-2]="VK";
		for (int i=0;i<l-1;i++) {
			if(sto[i].equals("VK"))
				count++;
		}

		/*if(sto[0].equals("VK"))
			count++;
		if(l<2)
			if(sto[l-2].equals("VK"))
				count++;

		if(flag==1)
			count++;
		*/
		System.out.println(count);

	}
}

import static java.lang.Math.*;
import static java.util.Arrays.* ;

import java.util.*;
import java.io.*;

public class D
{

    void main() throws Exception
    {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        char [] s = sc.next().toCharArray() ;
        int cnt[] = new int [2] ;

        for(int i = 0 ; i < s.length ;)
        {
            if(s[i] == 'K')
                i++ ;
            else
            {
                if(i + 1 < s.length && s[i] == 'V' && s[i + 1] == 'V')
                    cnt[1]++ ;
                else if(i + 1 < s.length && s[i] == 'V' && s[i + 1] == 'K')
                    cnt[0] ++ ;
                i += 2 ;
            }
        }
        out.println(cnt[0]+(cnt[1] > 0 ? 1 : 0));
        out.flush();
        out.close();
    }
    class Scanner
    {
        BufferedReader br;
        StringTokenizer st;

        Scanner(InputStream in)
        {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() throws Exception
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }
        String nextLine() throws Exception
        {
            return br.readLine() ;
        }
        int nextInt() throws Exception { return Integer.parseInt(next()); }

        long nextLong() throws Exception { return Long.parseLong(next()); }

        double nextDouble() throws Exception { return Double.parseDouble(next());}
    }

    public static void main (String [] args) throws Exception {(new D()).main();}

}

import java.util.*;

public class VK {

public static void main(String args[]){

        Scanner s = new Scanner(System.in);
         char c[] = s.next().toCharArray();
         int count = 0;
         boolean plus = false;
         if(c.length == 2 && c[0]=='V' && c[1] =='V'){
             System.out.println(1);
             return;
         }
         for(int i= 0;i<c.length;i++){

              if(i+1<c.length) {
                  if (c[i] == 'K' && c[i + 1] == 'K') {
                      plus = true;
                      i++;
                  } else if (c[i] == 'V' && c[i + 1] == 'K') {
                      count++;
                      i++;
                  }
                  else if(i+2<c.length && (c[i] == 'V' && c[i + 1] == 'V' && c[i + 2] == 'V' )){
                      plus = true;
                      i = i+1;
                  }

              }
         }

         if(plus){
             count++;
         }

         System.out.println(count);

        }

        }

import java.io.*;
import java.util.InputMismatchException;

public class TaskA
{
	public static void main(String[] args)
	{
//		InputReader in = new InputReader(System.in);
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		Solver solver = new Solver(in, out);

		try
		{
			solver.solve();
			in.close();
		}
		catch (IOException e)
		{
			e.printStackTrace();
		}
		out.flush();
		out.close();
	}

	static class Solver
	{
		//		InputReader in;
		BufferedReader in;
		PrintWriter out;

		void solve() throws IOException
		{
//			String line = in.nextLine();
			String line = in.readLine();
			int len = line.length();
			int cnt = 0;
			int vv = 0;

			for (int i = 0; i < len - 1; i++)
			{
				if (line.charAt(i) == 'V' && line.charAt(i + 1) == 'K')
					cnt++;
				else if (line.charAt(i) == 'V' && line.charAt(i + 1) == 'V' && (
						(i < len - 2 && line.charAt(i + 2) == 'V') || (i >= len - 2)))
					vv++;
				else if (line.charAt(i) == 'K' && line.charAt(i + 1) == 'K')
					vv++;
			}

			if (vv > 0)
				vv = 1;

			out.println(cnt + vv);
		}

		public Solver(BufferedReader in, PrintWriter out)
		{
			this.in = in;
			this.out = out;
		}

	}

	static class InputReader
	{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public int read()
		{
			if (numChars == -1)
				throw new InputMismatchException();

			if (curChar >= numChars)
			{
				curChar = 0;
				try
				{
					numChars = stream.read(buf);
				}
				catch (IOException e)
				{
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}

			return buf[curChar++];
		}

		public int nextInt()
		{
			int c = read();

			while (isSpaceChar(c))
				c = read();

			int sgn = 1;

			if (c == '-')
			{
				sgn = -1;
				c = read();
			}

			int res = 0;

			do
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();

				res *= 10;
				res += c & 15;

				c = read();
			} while (!isSpaceChar(c));

			return res * sgn;
		}

		public int[] nextIntArray(int arraySize)
		{
			int array[] = new int[arraySize];

			for (int i = 0; i < arraySize; i++)
				array[i] = nextInt();

			return array;
		}

		public long nextLong()
		{
			int c = read();

			while (isSpaceChar(c))
				c = read();

			int sign = 1;

			if (c == '-')
			{
				sign = -1;

				c = read();
			}

			long result = 0;

			do
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();

				result *= 10;
				result += c & 15;

				c = read();
			} while (!isSpaceChar(c));

			return result * sign;
		}

		public long[] nextLongArray(int arraySize)
		{
			long array[] = new long[arraySize];

			for (int i = 0; i < arraySize; i++)
				array[i] = nextLong();

			return array;
		}

		public float nextFloat()
		{
			float result, div;
			byte c;

			result = 0;
			div = 1;
			c = (byte) read();

			while (c <= ' ')
				c = (byte) read();

			boolean isNegative = (c == '-');

			if (isNegative)
				c = (byte) read();

			do
			{
				result = result * 10 + c - '0';
			} while ((c = (byte) read()) >= '0' && c <= '9');

			if (c == '.')
				while ((c = (byte) read()) >= '0' && c <= '9')
					result += (c - '0') / (div *= 10);

			if (isNegative)
				return -result;

			return result;
		}

		public double nextDouble()
		{
			double ret = 0, div = 1;
			byte c = (byte) read();

			while (c <= ' ')
				c = (byte) read();

			boolean neg = (c == '-');

			if (neg)
				c = (byte) read();

			do
			{
				ret = ret * 10 + c - '0';
			} while ((c = (byte) read()) >= '0' && c <= '9');

			if (c == '.')
				while ((c = (byte) read()) >= '0' && c <= '9')
					ret += (c - '0') / (div *= 10);

			if (neg)
				return -ret;

			return ret;
		}

		public String next()
		{
			int c = read();

			while (isSpaceChar(c))
				c = read();

			StringBuilder res = new StringBuilder();

			do
			{
				res.appendCodePoint(c);

				c = read();
			} while (!isSpaceChar(c));

			return res.toString();
		}

		public boolean isSpaceChar(int c)
		{
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String nextLine()
		{
			int c = read();

			StringBuilder result = new StringBuilder();

			do
			{
				result.appendCodePoint(c);

				c = read();
			} while (c != -1 && !isNewLine(c));

			return result.toString();
		}

		public boolean isNewLine(int c)
		{
			return c == '\n';
		}

		public void close()
		{
			try
			{
				stream.close();
			}
			catch (IOException e)
			{
				e.printStackTrace();
			}
		}

		public InputReader(InputStream stream)
		{
			this.stream = stream;
		}

	}

	public TaskA(InputStream inputStream, OutputStream outputStream)
	{
//		InputReader in = new InputReader(inputStream);
		BufferedReader in = new BufferedReader(new InputStreamReader(inputStream));
		PrintWriter out = new PrintWriter(outputStream);
		Solver solver = new Solver(in, out);

		try
		{
			solver.solve();
			in.close();
		}
		catch (IOException e)
		{
			e.printStackTrace();
		}
		out.flush();
		out.close();
	}

}

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {

        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        int num = 0;
        List <Integer> failedPositions = new ArrayList<>();

        boolean isPrevSucc = false;
        int curPos = 0;
        while (curPos < s.length())
        {
            if (curPos == s.length() - 1)
            {
                if (!isPrevSucc)
                    failedPositions.add(curPos);
                break;
            }
            if (s.charAt(curPos) == 'V' && s.charAt(curPos + 1) == 'K')
            {
                num++;
                isPrevSucc = true;
                curPos += 2;
            }
            else {
                if (!isPrevSucc)
                    failedPositions.add(curPos);
                curPos++;
                isPrevSucc = false;
            }
        }
        for (int i = 0; i < failedPositions.size() - 1; i++) {
            if (failedPositions.get(i) + 1 == failedPositions.get( i + 1) && !(s.charAt(failedPositions.get(i))  == 'K' && s.charAt(failedPositions.get(i + 1)) == 'V'))
            {
                System.out.println(++num);
                return;
            }
        }
        System.out.println(num);

    }
}

import java.io.*;
import java.util.*;

public class A {

	public static void main(String[] args) {
		FastScanner sc=new FastScanner();
		char[] ch = sc.next().toCharArray();
		int ans = 0;

		boolean flag = true;
		for(int i = 0; i<ch.length-1; i++) {
			if(ch[i] == 'V' && ch[i+1]=='K') {
				ans++;
				i++;
			}
		}

		for(int i = 0; i<ch.length-1; i++) {
			if((ch[i] == 'V' && ch[i+1]=='V') || (ch[i] =='K' && ch[i+1] =='K'))
				flag = true;
		}

		System.out.println(ans + (flag ? 1 : 0 ));
	}

	static final Random random = new Random();

	static void sort(int[] a) {
		int n = a.length;
		for(int i =0; i<n; i++) {
			int val = random.nextInt(n);
			int cur = a[i];
			a[i] = a[val];
			a[val] = cur;
		}
		Arrays.sort(a);
	}

	static void sortl(long[] a) {
		int n = a.length;
		for(int i =0; i<n; i++) {
			int val = random.nextInt(n);
			long cur = a[i];
			a[i] = a[val];
			a[val] = cur;
		}
		Arrays.sort(a);
	}

	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (st == null  || !st.hasMoreTokens()) {
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		String nextLine() {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
		}
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
		double nextDouble() {
            return Double.parseDouble(next());
        }
	}

}

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String ch = in.nextLine();
        int count = 0;
        for (int i = 0; i < ch.length() - 1; i++) {
            if (ch.subSequence(i, i + 2).equals("VK")) {
                count++;
                i++;
            }
        }
        ch = ch.replaceAll("VK", "");
        if (ch.length() == 2) {
            System.out.println(count);
        } else {
            System.out.println(count + 1);
        }
    }

}

import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class ViciousKeyboard {
	public static void main(String[] args) {
		out = new PrintWriter(new BufferedOutputStream(System.out));
		Reader in = new Reader();
		String s = in.read();
		if(s.length() == 1) out.println(0);
		else if(s.length() == 2) out.println(1);
		else{
			char[] a = s.toCharArray();
			StringBuilder sb = new StringBuilder(s);
			int count = 0, len = a.length - 1;
			for(int i = 0; i < len; i++){
				if(a[i] == 'K') continue;
				else if(a[i] == 'V' && a[i + 1] == 'K') {
					count++;
					sb.setCharAt(i, 'A');
					sb.setCharAt(i + 1, 'A');
				}
			}
			if(sb.indexOf("VV") > 0 || sb.indexOf("KK") > 0) count++;
			out.println(count);
		}
		in.close();
		out.close();
	}
	static PrintWriter out;
	static class Reader {
		BufferedReader br;
		StringTokenizer st;
		public Reader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		String read() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		int readInt() {
			return Integer.parseInt(read());
		}
		long readLong() {
			return Long.parseLong(read());
		}
		double readDouble() {
			return Double.parseDouble(read());
		}
		char readChar() {
			return read().charAt(0);
		}
		int[] readIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = readInt();
			return a;
		}
		long[] readLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = readLong();
			return a;
		}
		double[] readDoubleArray(int n) {
			double[] a = new double[n];
			for (int i = 0; i < n; i++)
				a[i] = readDouble();
			return a;
		}
		String[] readStringArray(int n) {
			String[] s = new String[n];
			for (int i = 0; i < n; i++)
				s[i] = read();
			return s;
		}
		char[] readCharArray(int n) {
			char[] ch = new char[n];
			for (int i = 0; i < n; i++)
				ch[i] = readChar();
			return ch;
		}
		String readLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
		void close() {
			try {
				br.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}

import java.util.Scanner;

/**
 * Created by alexwu on 2017/5/4.
 */
public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String input = sc.next();

        int flag = 0;
        int pos = 0;
        int ans = 0;
        for (int i = 0; i < input.length(); ) {
            if (i+1 < input.length() && input.charAt(i) == 'V' && input.charAt(i + 1) == 'K') {
                i += 2;
                ans++;
                pos = ans;
            } else if (i > pos && input.charAt(i) == input.charAt(i-1)) {
                flag = 1;
                i += 2;
            } else i++;
        }

        System.out.println(ans + flag);
    }
}

import java.io.*;
import java.util.StringTokenizer;

public class Codeforces_round_409_div_2_ViciousKeyboard {

    public static void main(String[] args) {
        FScanner input = new FScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out), true);
        String line = input.nextLine();
        StringBuilder current = new StringBuilder();
        int answer = 0;
        if (line.equals("VV") || line.equals("KK")) {
            out.println(1);
        } else {
            for (int i = 0; i < line.length(); i++) {
                if (current.length() >= 2) {
                    current = current.deleteCharAt(0);
                }
                current = current.append(line.charAt(i));
                if (current.length() == 2 && current.toString().equals("VK")) {
                    answer++;
                }
            }
            String currentLine = line;
            while (currentLine.length() >= 2) {
                int vIndex = currentLine.indexOf("VV");
                int kIndex = currentLine.indexOf("KK");
                int nIndex = currentLine.indexOf("KV");
                if (vIndex != -1) {
                    if (vIndex + 2 < currentLine.length()) {
                        if (currentLine.charAt(vIndex + 2) != 'K') {
                            answer++;
                            break;
                        }
                    }
                } else if (kIndex != -1) {
                    if ((kIndex - 1) < currentLine.length() && (kIndex - 1) >= 0) {
                        if (currentLine.charAt(kIndex - 1) != 'V') {
                            answer++;
                            break;
                        }
                    }
                } else if (nIndex != -1) {
                    if (nIndex - 1 < currentLine.length() && (nIndex - 1) >= 0) {
                        if (currentLine.charAt(nIndex - 1) != 'V') {
                            answer++;
                            break;
                        }
                    }
                    if (nIndex + 2 < currentLine.length()) {
                        if (currentLine.charAt(nIndex + 2) != 'K') {
                            answer++;
                            break;
                        }
                    }
                }
                if (currentLine.length() > 2) {
                    currentLine = currentLine.substring(2);
                } else {
                    break;
                }
            }
            out.println(answer);
        }
        out.close();
    }

    public static PrintWriter out;

    public static class FScanner {
        BufferedReader br;
        StringTokenizer st;

        public FScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        private String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
}

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.*;

public class Main {
    public static void main(String arg[]) {
        InputReader in = new InputReader(System.in);
        OutputWriter out = new OutputWriter(System.out);
        int count = 0;
        int c = 0;
        String s = in.readString();
        for(int i = 0; i < s.length()-1; i++){
            if(s.charAt(i) == 'V' && s.charAt(i+1) == 'K'){
                count++;
                i++;
            }
            else if((s.charAt(i) == 'V' && s.charAt(i+1) == 'V')||(s.charAt(i) == 'K' && s.charAt(i+1) == 'K')){
                c = 1;
                if(s.charAt(i) == 'V' && s.charAt(i+1) == 'V'){
                    i++;
                }
            }

        }
        out.printLine(c+count);
        out.flush();
        out.close();
    }
}
class Node implements Comparable<Node>{
    int val;
    int c;
    HashSet<Integer> color;
    ArrayList<Integer> ar;
    int degree;
    Node(int i){
        this.val = i;
        color = new HashSet<Integer>();
        ar = new ArrayList<Integer>();
    }
    @Override
    public int compareTo(Node arg0) {
        // TODO Auto-generated method stub
        return Integer.compare(arg0.ar.size(), this.ar.size());
    }

}
class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public String next() {
        return readString();
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

    public void flush() {
        writer.flush();
    }
}

class IOUtils {

    public static int[] readIntArray(InputReader in, int size) {
        int[] array = new int[size];
        for (int i = 0; i < size; i++)
            array[i] = in.readInt();
        return array;
    }

}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;

public class Puzzles {

    public static void main(String[] args) {
        Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));

        String s = sc.next();

        s=s.toUpperCase();
        char[] a = s.toCharArray();

        int count = 0;
        int z = 0;

        for (int i = 0; i < a.length - 1; i++) {
            if (a[i] == 'V' && a[i + 1] == 'K') {
                count++;

              }

            }
        for (int i = 0; i < a.length - 1; i++) {
            if (a[i] == 'V' && a[i + 1] == 'V') {
                count++;
                break;
              }
            if (a[i] == 'K' && a[i + 1] == 'K') {
                count++;
                break;
              }

            }

        System.out.println(count);
    }

}

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;
import java.util.StringTokenizer;
import javax.swing.tree.TreeNode;

public class codeforces {

    public static int Binary(int x,int array[]){
        int min=0;
        int max=array.length-1;
        int mid=0;
        while(min<max){
            mid=(max+min)/2;
            if (array[mid]==x)return mid;
            if (x>array[mid])min=mid+1;
            if (x<array[mid])max=mid-1;

        }

    return 0;}

    public static void main(String[] args) throws IOException {
        Reader.init(System.in);
        PrintWriter pw=new PrintWriter(System.out);
        StringBuilder sb=new StringBuilder("");
        String x=Reader.next();
        char ch[]=x.toCharArray();
        int count=0,count2=0;

        for (int i = 0; i < ch.length-1; i++) {
            if(ch[i]=='V'&&ch[i+1]=='K'){count++;i=i+1;}
            else if(ch[i]=='V'&&ch[i+1]=='V'&&count2==0){count++;count2=1;i=i+1;}
        }
        pw.println(count);

        pw.close();

    }

    }

 class Reader {

        static BufferedReader reader;
        static StringTokenizer tokenizer;

        public static int pars(String x) {
            int num = 0;
            int i = 0;
            if (x.charAt(0) == '-') {
                i = 1;
            }
            for (; i < x.length(); i++) {
                num = num * 10 + (x.charAt(i) - '0');
            }

            if (x.charAt(0) == '-') {
                return -num;
            }

            return num;
        }

        static void init(InputStream input) {
            reader = new BufferedReader(
                    new InputStreamReader(input));
            tokenizer = new StringTokenizer("");
        }

        static void init(FileReader input) {
            reader = new BufferedReader(input);
            tokenizer = new StringTokenizer("");
        }

        static String next() throws IOException {
            while (!tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(
                        reader.readLine());
            }
            return tokenizer.nextToken();
        }

        static int nextInt() throws IOException {
            return pars(next());
        }

        static long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        static double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }
    }

import java.util.Scanner;
public class omar{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        String x=sc.next();
        char k[]=x.toCharArray();
        int r=0;
        int o=0;
        if(k.length==2){
            System.out.println(1);
            System.exit(0);
        }
        for(int i=0;i<k.length-1;i++) {
            if(k[i]=='V' && k[i+1]=='K'){
                r++;
                i++;
            }
        }
        for(int c=1;c<k.length-2;c++){
            if(k[c]=='K' && k[c+1]=='K' && k[c-1]!='V' || k[c-1]=='V' && k[c]=='V' && k[c+1]!='K'){
                r++;
                break;
            }
            else{
                c++;
            }
        }
        System.out.println(r);
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class A {

    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String s = br.readLine();
            boolean lastv = s.charAt(0) == 'V';
            int[] n = new int[100];
            int idx = 0;
            n[idx] = 1;
            int ans = 0;
            for (int i = 1; i < s.length(); ++i) {
                if ((lastv && s.charAt(i) != 'V') || (!lastv && s.charAt(i) == 'V')) {
                    idx++;
                }
                lastv = s.charAt(i) == 'V';
                n[idx]++;
                if (n[idx] > 2) {
                    ans = 1;
                }
            }
            if (s.charAt(0) == 'V') {
                idx++;
            }else if(n[0] == 2){
                ans++;
            }
            ans += idx / 2;
            if (s.length() == 2) {
                ans = 1;
            }
            System.out.println(ans);
        } catch (IOException ex) {
        }
    }
}

import java.util.Scanner;

public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        String in = sc.nextLine();

        int length = in.length();

        int max = 0;

        for(int i = 0; i < length; i++) {
            char replace = 'K';

            if(in.charAt(i) == 'K')
                replace = 'V';

            StringBuilder temp = new StringBuilder(in);
            temp.setCharAt(i, replace);

            int result = occurance(temp);

            if(result > max)
                max = result;
        }

        System.out.println(max);
    }

    public static int occurance(StringBuilder in) {
        int count = 0;

        int a = in.lastIndexOf("VK");

        while(a != -1) {
            count++;

            in.delete(a, a + 2);

            a = in.lastIndexOf("VK");
        }

        return count;
    }
}

import java.util.Scanner;
import java.util.StringTokenizer;

public class A {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		char[] input = scan.nextLine().toCharArray();

		int ans = 0;
		for (int i=0; i<input.length-1; i++) {
			if (input[i] == 'V' && input[i+1] == 'K') {
				ans++;
				input[i] = '*';
				input[i+1] = '*';
			}

		}
		for (int i=0; i<input.length-1; i++){
			if (i==0 && input[i] == 'V' && input[i+1] != '*') {
				ans++;
				break;
			} else if (input[i] != '*' && input[i+1] != '*'){
				ans++;
				break;
			}
		}
		System.out.println(ans);

	}

}

import java.util.Scanner;

public class ViciousKeyboard {
	public static void main(String [] args){
		Scanner sc = new Scanner(System.in);
		String Test = sc.next();
		sc.close();
		int Counter = 0 ;
		boolean Possible1 = false ;
		for(int i = 0 ; i < Test.length()-1 ; i ++){
			if(Test.charAt(i) == 'V' && Test.charAt(i+1) =='K'){
				Counter ++ ;}
			if(!(i+ 2 >= Test.length())){
				if(Test.charAt(i) == 'V' && Test.charAt(i+1) =='V' && Test.charAt(i+2) == 'V' ){
					Possible1 = true ;}
				if(Test.charAt(i) == 'K' && Test.charAt(i+1) =='K' && Test.charAt(i+2) == 'K' ){
					Possible1 = true ;}}
			else if(!(i+ 1 >= Test.length())){
				if(Test.charAt(i) == 'V' && Test.charAt(i+1) =='V'){
					Possible1 = true ;}
				if(Test.charAt(i) == 'K' && Test.charAt(i+1) =='K'){
					Possible1 = true ;}
				}
			}
		if(Possible1)
			Counter ++ ;
		System.out.println(Counter);
		}
}

import java.util.Scanner;

public class JavaApplication1 {

    public static void main(String[] args) {

       // System.out.println("hello");\
       Scanner s=new Scanner(System.in);
       String str=s.next();
       int count=0;
       for(int i=0;i<str.length()-1;i++)
       {
           if(str.charAt(i)=='V' && str.charAt(i+1)=='K')
               count++;
       }

       if(str.length()==1)
           System.out.println("0");
       else if(str.length()==2)
       {
           if(str.equalsIgnoreCase("vk"))
               System.out.println("1");
           else if(str.equalsIgnoreCase("vv"))
               System.out.println("1");
           else
               System.out.println("0");
       }
       else
       {
           if(str.contains("VVV"))
               System.out.println(count+1);
           else if(str.contains("KKK"))
               System.out.println(count+1);
           else System.out.println(count);
       }

    }

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author zodiacLeo
 */
public class Main
{
    public static void main(String[] args)
    {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        FastPrinter out = new FastPrinter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA
    {
        public void solve(int testNumber, FastScanner in, FastPrinter out)
        {
            String before = in.next();
            String after = before.replaceAll("VK", "");
            int cnt = (before.length() - after.length()) / 2;
            if (after.length() >= 2)
            {
                int index = after.indexOf("V");
                if (index + 1 < after.length())
                {
                    cnt++;
                    out.println(cnt);
                    return;
                }

                index = after.indexOf("K");
                if (index - 1 >= 0)
                {
                    cnt++;
                    out.println(cnt);
                    return;
                }
            }
            out.println(cnt);
        }

    }

    static class FastScanner
    {
        public BufferedReader br;
        public StringTokenizer st;

        public FastScanner(InputStream is)
        {
            br = new BufferedReader(new InputStreamReader(is));
        }

        public FastScanner(File f)
        {
            try
            {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e)
            {
                e.printStackTrace();
            }
        }

        public String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                String s = null;
                try
                {
                    s = br.readLine();
                } catch (IOException e)
                {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

    }

    static class FastPrinter extends PrintWriter
    {
        public FastPrinter(OutputStream out)
        {
            super(out);
        }

        public FastPrinter(Writer out)
        {
            super(out);
        }

    }
}

import java.util.*;

public class Main {
	public static void main(String[] args) {
	      // Use the Scanner class
	     try{
	      Scanner sc = new Scanner(System.in);
	      String s=sc.next();
	      int r=0,v=0;
	      for(int i=0; i<s.length()-1;i++){
	    	  if(s.charAt(i)=='V' && s.charAt(i+1)=='K'){
	    		  r++;
	    	  }
	    	  if((s.charAt(i)=='V' && s.charAt(i+1)=='V') || (s.charAt(i)=='K' && s.charAt(i+1)=='K')){
	    		  v++;
	    		  if(s.charAt(i)=='V' && s.charAt(i+1)=='V') {
	    			  s=s.substring(0, i+1)+'K'+s.substring(i+2);
	    		  }
	    	  }
	      }
	      if(v>0) r++;
	      System.out.println(r);
	     }
	     catch(NoSuchElementException e){

	     }
	  }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class A {

    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String s = br.readLine();
            boolean lastv = s.charAt(0) == 'V';
            int[] n = new int[100];
            int idx = 0;
            n[idx] = 1;
            int ans = 0;
            for (int i = 1; i < s.length(); ++i) {
                if ((lastv && s.charAt(i) != 'V') || (!lastv && s.charAt(i) == 'V')) {
                    idx++;
                }
                lastv = s.charAt(i) == 'V';
                n[idx]++;
                if (n[idx] > 2 || (idx == 0 && n[idx] == 2)) {
                    ans = 1;
                }
            }
            if (s.charAt(0) == 'V') {
                idx++;
            }
            ans += idx / 2;
            if (s.length() == 2) {
                ans = 1;
            }
            System.out.println(ans);
        } catch (IOException ex) {
        }
    }
}

import java.util.*;
import java.math.*;
import java.io.*;
import java.text.*;

public class practice {
    public static void merge(int arr[], int l, int m, int r) {
        // Find sizes of two subarrays to be merged
        int n1 = m - l + 1;
        int n2 = r - m;

        /* Create temp arrays */
        int L[] = new int[n1];
        int R[] = new int[n2];

        /*Copy data to temp arrays*/
        for (int i = 0; i < n1; ++i)
            L[i] = arr[l + i];
        for (int j = 0; j < n2; ++j)
            R[j] = arr[m + 1 + j];

        /* Merge the temp arrays */

        // Initial indexes of first and second subarrays
        int i = 0, j = 0;

        // Initial index of merged subarry array
        int k = l;
        while (i < n1 && j < n2) {
            if (L[i] <= R[j]) {
                arr[k] = L[i];
                i++;
            } else {
                arr[k] = R[j];
                j++;
            }
            k++;
        }

        /* Copy remaining elements of L[] if any */
        while (i < n1) {
            arr[k] = L[i];
            i++;
            k++;
        }

        /* Copy remaining elements of R[] if any */
        while (j < n2) {
            arr[k] = R[j];
            j++;
            k++;
        }
    }

    // Main function that sorts arr[l..r] using
    // merge()
    public static void sort(int arr[], int l, int r) {
        if (l < r) {
            // Find the middle point
            int m = (l + r) / 2;

            // Sort first and second halves
            sort(arr, l, m);
            sort(arr, m + 1, r);

            // Merge the sorted halves
            merge(arr, l, m, r);
        }
    }

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        int count = 0;
        boolean flag = false;
        for (int i = 0; i < s.length() - 1; i++) {
            if (s.charAt(i) == 'V' && s.charAt(i + 1) == 'K') {
                count++;
            }
        }
        if (s.length() == 2) {
            if (s.charAt(0) == s.charAt(1)) flag = true;
        } else {
            for (int i = 0; i < s.length() - 2; i++) {
                if (s.charAt(i) == s.charAt(i + 1) && s.charAt(i) == s.charAt(i + 2)) {
                    flag = true;
                }
            }
        }
        if(flag)count++;
        System.out.println(count);
    }
}

class sort implements Comparator<ArrayList<Long>> {

    @Override
    public int compare(ArrayList<Long> o1, ArrayList<Long> o2) {
        int c = o1.get(2).compareTo(o2.get(2));
        return c;
    }

}

//package usaco;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class VK {

	public static void main(String[] args) throws IOException {
		BufferedReader f=new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(
				System.out)));
		StringTokenizer st=new StringTokenizer(f.readLine());

		String s = st.nextToken();
		int vk = 0;
		boolean changed = false;
		for(int i = 0; i < s.length()-1; i++){
			if(s.substring(i,i+2).equals("VK")){
				vk++;
			}
			else if(s.substring(i,i+2).equals("VV") && !changed){
				vk++;
				changed = true;
			}
		}

		System.out.println(vk);
		System.out.close();

	}

}

import java.util.Scanner;

public class HarmfulKeyboard {

	public static void main(String[] args) throws Exception {
		Scanner in = new Scanner(System.in);
		String inStr = in.nextLine();
		in.close();

		int maxOccurrence = inStr.equals("VK") ? 1 : 0;

		for (int r = 0; r < inStr.length() - 1; r++) {
			int maxVarOccurrence = 0;

			for (int i = 0; i < inStr.length() - 1; i++) {
				String curStr = String.valueOf(inStr.charAt(i));
				String nextStr = String.valueOf(inStr.charAt(i + 1));

				if (i == r) {
					nextStr = inStr.charAt(i + 1) == 75 ? "V" : "K";
				}

				if ((curStr + nextStr).equals("VK")) {
					maxVarOccurrence += 1;
				}
			}

			if (maxVarOccurrence > maxOccurrence) {
				maxOccurrence = maxVarOccurrence;
			}
		}

		System.out.println(maxOccurrence);
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author zodiacLeo
 */
public class Main
{
    public static void main(String[] args)
    {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        FastPrinter out = new FastPrinter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA
    {
        public void solve(int testNumber, FastScanner in, FastPrinter out)
        {
            String before = in.next();
            String after = before.replaceAll("VK", "-");
            int cnt = (before.length() - after.length());
            if (after.length() >= 2)
            {
                int index = after.indexOf("VV");
                if (index != -1 && index + 1 < after.length())
                {
                    cnt++;
                    out.println(cnt);
                    return;
                }

                index = after.lastIndexOf("KK");
                if (index != -1 && index - 1 >= 0)
                {
                    cnt++;
                    out.println(cnt);
                    return;
                }
            }
            out.println(cnt);
        }

    }

    static class FastScanner
    {
        public BufferedReader br;
        public StringTokenizer st;

        public FastScanner(InputStream is)
        {
            br = new BufferedReader(new InputStreamReader(is));
        }

        public FastScanner(File f)
        {
            try
            {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e)
            {
                e.printStackTrace();
            }
        }

        public String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                String s = null;
                try
                {
                    s = br.readLine();
                } catch (IOException e)
                {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

    }

    static class FastPrinter extends PrintWriter
    {
        public FastPrinter(OutputStream out)
        {
            super(out);
        }

        public FastPrinter(Writer out)
        {
            super(out);
        }

    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Abdulrahman Mubarak
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader input, PrintWriter out) {
            char[] ch = input.next().toCharArray();
            int count = 0;
            int step = 0;
            if (ch.length < 2) {
                out.println(0);
                return;
            }
            int i = 0;
            for (; i < ch.length; i++) {
                if (ch[i] == 'V') {
                    if (i + 1 < ch.length && ch[i + 1] == 'K') {
                        count++;
                        i++;
                    } else if (i + 1 < ch.length && ch[i + 1] == 'V') {
                        count++;
                        ch[i + 1] = 'K';
                        i++;
                        break;
                    }
                } else {
                    if (i >= 2) {
                        if (i - 2 >= 0 && ch[i - 1] == 'K' && ch[i - 2] == 'K') {
                            count++;
                            ch[i - 1] = 'V';
                            i++;
                            break;
                        }
                    } else {
                        if (i - 1 >= 0 && ch[i - 1] == 'K') {
                            count++;
                            ch[i - 1] = 'V';
                            i++;
                            break;
                        }
                    }
                }
            }

            for (; i < ch.length; i++) {
                if (ch[i] == 'V') {
                    if (i + 1 < ch.length && ch[i + 1] == 'K') {
                        count++;
                        i++;
                    }
                }
            }
            out.println(count);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

    }
}

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class viciousKeyboard {

	public static void main(String[] args) throws IOException {

		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		String str = f.readLine();

		int c = 0;
		boolean add= false;

		if (str.length() == 1){

			c = 0;

		}else{

			for (int i = 0; i < str.length(); i++){
				if (i != str.length()-1 && str.charAt(i) == 'V' && str.charAt(i+1) == 'K'){
					c++;
				}
				if (i != str.length()-1 && str.charAt(i) == 'V' && str.charAt(i+1) == 'V'){
					add = true;
				}
				if (i != str.length()-1 && i != 0 && str.charAt(i-1) == 'K' && str.charAt(i) == 'K'){
					add = true;
				}
			}

			if (add){
				c++;
			}

		}

		System.out.print(c);
		System.out.close();

	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class ViciousKeyboard {
  public static void main(String[] args) {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
           InputReader in = new InputReader(inputStream);
            PrintWriter out = new PrintWriter(outputStream);
           TaskA solver = new TaskA();
            solver.solve(1, in, out);
            out.flush();
    }
  static class TaskA{
        void solve(int t,InputReader in,PrintWriter out){
            char str[] = in.next().toCharArray();
            int cnt = 0;
            for (int i = 1; i < str.length; i+=3) {
                if(str[i-1] == 'V' && str[i] == 'V'){
                    str[i] = 'K';
                    break;
                }
                else if(str[i-1] == 'K' && str[i] == 'K'){
                        str[i-1] = 'V';
                        break;
                }
                else{
                    if(str[i-1] == 'K' && str[i] == 'V'){
                        str[i-1] = 'V';
                        str[i] = 'K';
                        break;
                    }
                }
            }
            for (int i = 1; i < str.length; i++) {
                if(str[i-1] == 'V' && str[i] == 'K')
                    ++cnt;
            }
            out.println(cnt);
        }
  }
     static class InputReader{
        public BufferedReader reader;
        public StringTokenizer tk;
        public InputReader(InputStream stream){
           reader = new BufferedReader(new InputStreamReader(stream));
           tk = null;
        }
         String next(){
            while (tk == null || !tk.hasMoreTokens()) {
                try{
                    tk = new StringTokenizer(reader.readLine());
                }
                catch(IOException e){
                    throw new RuntimeException(e);
                }
            }
            return tk.nextToken();
        }
         int nextInt(){
         return Integer.parseInt(next());
        }
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author zodiacLeo
 */
public class Main
{
    public static void main(String[] args)
    {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        FastPrinter out = new FastPrinter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA
    {
        public void solve(int testNumber, FastScanner in, FastPrinter out)
        {
            String line = in.next();
            int from = 0;
            int cnt = 0;
            while (true)
            {
                int index = line.indexOf("VK", from);
                if (index < 0)
                {
                    break;
                }
                cnt++;
                from = index + 1;
            }
            line = line.replaceAll("VK", "");
            if (line.length() >= 2)
            {
                int index = line.indexOf("V");
                if (index + 1 < line.length())
                {
                    cnt++;
                }
            }
            out.println(cnt);

        }

    }

    static class FastScanner
    {
        public BufferedReader br;
        public StringTokenizer st;

        public FastScanner(InputStream is)
        {
            br = new BufferedReader(new InputStreamReader(is));
        }

        public FastScanner(File f)
        {
            try
            {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e)
            {
                e.printStackTrace();
            }
        }

        public String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                String s = null;
                try
                {
                    s = br.readLine();
                } catch (IOException e)
                {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

    }

    static class FastPrinter extends PrintWriter
    {
        public FastPrinter(OutputStream out)
        {
            super(out);
        }

        public FastPrinter(Writer out)
        {
            super(out);
        }

    }
}

import org.omg.CORBA.MARSHAL;

import java.io.*;
//import java.lang.reflect.Array;
import java.lang.reflect.Array;
import java.util.*;

public class citylights {
    public static int[] arr;
    public static ArrayList<Integer> p;
    public static int[] val;
    public static long[] facto;
    public static long mod = 100000;
    public static long[] fillme;
    // public static HashMap<pair, Integer> hs;
    public static int ans = 0;
    public static int n, k;
    public static int [][]a;
    public static int []cnt=new int[27];
    static InputReader in;
    static PrintWriter out;
    // public static int []tt;

//--------------------------------------My Code--------------------------------------------

    public static void main(String[] args) throws IOException {
        arr = new int[1000001];
        p = new ArrayList<>();
        val = new int[1000001];
        facto = new long[1000007];
        //tt=new int[100];

        fillme = new long[1000007];

        // sieve();
        in = new InputReader(System.in);
        out = new PrintWriter(System.out);

        String str=in.readString();
        boolean []a=new boolean[str.length()];

        int count=0;
        int use=0;
        for (int i=1;i<str.length();i++)
        {
            if(str.charAt(i)=='K' && str.charAt(i-1)=='V' && !a[i] && !a[i - 1])
            {
                count++;
                a[i]=true;
                a[i-1]=true;

            }
            else if(use==0 && str.charAt(i-1)=='k' && str.charAt(i-1)=='K' && !a[i] && !a[i-1])
            {
                use++;
                a[i]=true;
                a[i-1]=true;
            }else if(use==0 && str.charAt(i-1)=='V' && str.charAt(i-1)=='V' && !a[i] && !a[i-1])
            {
                use++;
                a[i]=true;
                a[i-1]=true;

            }
        }
        out.println(count+use);

        out.close();
    }
    //-------------------------------------------Code ends-------------------------------

    static class trio{

        int x;
        int o;
        boolean kia=false;

        public trio(int x, int o,boolean kia) {
            this.x = x;
            this.o = o;
            this.kia=kia;

        }
    }
    public static long bsearchg(int[] a, int t) {
        long ans = 0;
        int low = 0;
        int high = a.length - 1;
        while (low <= high) {
            int mid = (low + high) / 2;
            if (a[mid] <= t) {
                ans = mid;

                low = mid + 1;
            } else
                high = mid - 1;

        }
        return ans;

    }

    private static long fib(long n) {
        if (n == 1) return 2l;
        if (n == 0) return 1l;
        long[][] F = new long[][]{{1, 1}, {1, 0}};
        matPow(F, n);
        return F[0][0];
        //return 0l;
    }

    private static void matPow(long[][] F, long n) {
        if (n == 0 || n == 1)
            return;
        long M[][] = new long[][]{{1, 1}, {1, 0}};

        matPow(F, n / 2);
        matrixMult(F, F);

        if (n % 2 != 0)
            matrixMult(F, M);
    }

    private static void matrixMult(long A[][], long M[][]) {
        long a = ((A[0][0] * M[0][0]) % mod + (A[0][1] * M[1][0]) % mod) % mod;
        long b = ((A[0][0] * M[0][1]) % mod + (A[0][1] * M[1][1]) % mod) % mod;
        long c = ((A[1][0] * M[0][0]) % mod + (A[1][1] * M[1][0]) % mod) % mod;
        long d = ((A[1][0] * M[0][1]) % mod + (A[1][1] * M[1][1]) % mod) % mod;

        A[0][0] = a;
        A[0][1] = b;
        A[1][0] = c;
        A[1][1] = d;
    }

    private static long lcm(long a, long b) {
        return (long) ((a * b) / euclgcd(a, b));
    }

    public static int[] rotate(int[] order, int by) {
        int length = order.length;
        int[] a = new int[length];
        for (int i = 0; i < length; i++) {
            a[(i + by) % length] = order[i];

        }
        return a;

    }

    public static long modinv(long x, long m) {
        return powmod(x, m - 2, m);

    }

    public static long eulertoitent(long n) {
        long res = n;
        for (int i = 2; i * i <= n; i++)
            if (n % i == 0) {
                while (n % i == 0)
                    n /= i;
                res -= res / i;
            }
        if (n > 1)
            res -= res / n;
        return res;

    }

    //calculate factorial till modulas
    public static void fact() {
        facto[0] = 1;
        for (int i = 1; i <= mod; i++) {
            facto[i] = (i * facto[i - 1]) % mod;
        }

    }

    public static void sieve() {
        arr[0] = 1;
        arr[1] = 1;

        for (int i = 2; i * i < 1000001; i++) {
            if (arr[i] == 0) {

                for (int j = i * i; j < 1000001; j += i) {
                    arr[j] = 1;
                }
            }
        }
        for (int i = 2; i < 1000001; i++) {
            if (arr[i] == 0)
                p.add(i);
        }
    }

    public static boolean isPrime(int n) {
        // Corner cases
        if (n <= 1) return false;
        if (n <= 3) return true;

        // This is checked so that we can skip
        // middle five numbers in below loop
        if (n % 2 == 0 || n % 3 == 0) return false;

        for (int i = 5; i * i <= n; i = i + 6)
            if (n % i == 0 || n % (i + 2) == 0)
                return false;

        return true;
    }

    public static long euclgcd(long a, long b) {
        if (b == 0)
            return a;
        else
            return euclgcd(b, a % b);

    }

    public static long powmod(long x, long n, long m) {
        long result = 1L;
        while (n > 0) {
            if (n % 2 == 1)
                result = (result * x) % m;
            x = (x * x) % m;
            n = n / 2;
        }

        return result;
    }

    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }

}

import java.util.*;
import java.lang.*;
public class Main
{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	    String s = sc.next();
	    int n = s.length();
	    int c = 0;
	    int v = 0;
	    int k = 0;
	    for(int i=0;i<n-1;i++){
	        if(s.charAt(i)=='V'&&s.charAt(i+1)=='K'){
	            c++;
	        }
	        if(s.charAt(i)=='V') v++;
	        else k++;
	    }
	    if(n%2==0&&c>=(n/2 - 1)) System.out.println(c);
	    else if(n%1==0&&c==(n/2)) System.out.println(c);
	    else System.out.println(c+1);
	}
}

import java.util.Scanner;
public class mainn
{
	public static void main(String[] args)
	{
		String s;
		Scanner input=new Scanner(System.in);
		s=input.nextLine();
		int output=0;
		if(s.length()==1)
		{
			System.out.println('0');
			return;
		}
		int vvv=s.indexOf("VVV");
		int kkk=s.indexOf("KKK");
		if(vvv!=-1 ||kkk!=-1)
			output++;
		vvv=-2;
		kkk=-2;
		if(s.charAt(s.length()-2)=='V'&&s.charAt(s.length()-1)=='V'&& vvv!=-2 &&kkk!=-2)
			vvv=1;
		if(s.charAt(0)=='K'&&s.charAt(1)=='K'&& vvv!=-2 && kkk!=-2)
			kkk=1;
		for(int i=0;i<s.length()-1;i++)
		{
			if(s.charAt(i)=='V' && s.charAt(i+1)=='K')
				output++;
		}
		if(vvv==1 || kkk==1)
			output++;
		System.out.println(output);
	}
}

//package again;

import java.util.Scanner;

/**
 *
 * @author Mahmoud
 */
public class Again {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String vk =sc.next();

        if(vk.equals("VV") || vk.equals("KK") || vk.equals("VK"))
        {
            System.out.println(1);
        }
        else
        {
        StringBuilder sb = new StringBuilder(vk);

        int index = 0, total = 0;
        while(index < sb.length())
        {

            index = sb.indexOf("VK", index);

            if(index == -1)
                break;

            total++;
            index += 2;

        }
       if(sb.indexOf("VVV") != -1 || sb.indexOf("KKK") != -1)
           total++;
        System.out.println(total);
        }
}
}

import java.io.*;
import java.util.Scanner;

public class Solution {

    public static void main(String[] args) throws IOException {
        //BufferedReader in = new BufferedReader(new FileReader(new File("input.txt")));
        BufferedWriter out = new BufferedWriter(new FileWriter(new File("output.txt")));
        Scanner in = new Scanner(System.in);
        //BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        //PrintWriter pw = new PrintWriter(System.out, true);

        StringBuilder s = new StringBuilder(in.nextLine());
        int c = 0;
        if(s.length() < 2){
            System.out.println("0");
            System.exit(0);
        }
        /*while (s.indexOf("VK") > -1){
            s.delete(s.indexOf("VK"),s.indexOf("VK") + 2);

        }*/

        for (int i = 0; i < s.length()-1; i++) {

            if(s.charAt(i) == 'V' && s.charAt(i+1) == 'K'){
                c++;
            }
        }
        if(s.length() == 2){
            if(s.indexOf("KK") > -1){
                c++;
            }else if(s.indexOf("VV") > -1){
                c++;
            }
        }else if(s.indexOf("KKK") > -1){
            c++;
        }else if(s.indexOf("VVV") > -1){
            c++;
        }
        System.out.println(c);
        in.close();
        out.close();
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            String s = in.n();
            int len = s.length();
            if (len == 1) {
                out.println(0);
                return;
            }
            StringBuilder sb = new StringBuilder(s);
            int count = 0;
            boolean once = false;
            for (int i = 0; i < len - 1; i++) {
                if (sb.charAt(i) == 'V' && sb.charAt(i + 1) == 'K') {
                    count++;
                    i++;
                } else if (sb.charAt(i) == 'V' && sb.charAt(i + 1) == 'V' && !once) {
                    sb.setCharAt(i + 1, 'K');
                    once = true;
                    i++;
                    count++;
                } else if (sb.charAt(i) == 'K' && sb.charAt(i + 1) == 'K' && !once) {
                    sb.setCharAt(i, 'V');
                    once = true;
                    count++;
                    i++;
                }
            }
            out.println(count);
        }

    }

    static class InputReader {
        BufferedReader br;
        StringTokenizer st;

        public InputReader(InputStream inputStream) {
            br = new BufferedReader(new InputStreamReader(inputStream));
        }

        public String n() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

    }
}

//package usaco;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class VK {

	public static void main(String[] args) throws IOException {
		BufferedReader f=new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(
				System.out)));
		StringTokenizer st=new StringTokenizer(f.readLine());

		String s = st.nextToken();
		int vk = 0;
		boolean changed = false;
		for(int i = 0; i < s.length()-1; i++){
			if(s.substring(i,i+2).equals("VK")){
				vk++;
			}
			else if(i+2>=s.length()&&s.substring(i,i+2).equals("VV") && !changed){
				vk++;
			}
			else if(s.substring(i,i+2).equals("VV") && !changed && s.charAt(i+2)!='K'){
				vk++;
				changed = true;
			}
		}

		System.out.println(vk);
		System.out.close();

	}

}

import java.util.*;

public class Main {
	public static void main(String[] args) {
	      // Use the Scanner class
	     try{
	      Scanner sc = new Scanner(System.in);
	      String s=sc.next();
	      int r=0,v=0;
	      for(int i=0; i<s.length()-1;i++){
	    	  if(s.charAt(i)=='V' && s.charAt(i+1)=='K'){
	    		  r++;
	    	  }
	    	  if(s.charAt(i)=='V' && s.charAt(i+1)=='V'){
	    		  v++;
	    	  }
	      }
	      if(v>0) r++;
	      System.out.println(r);
	     }
	     catch(NoSuchElementException e){

	     }
	  }
}

import java.util.Scanner;

import javax.print.attribute.standard.MediaSize.ISO;

public class May_2 {

	public static void main(String [] args) {
		Scanner in = new Scanner(System.in);
		String str = in.nextLine();
//		System.out.println(str.substring(0, 4) + str.substring(6));
		System.out.println(caclVkCount(str));
	}

	public static int caclVkCount(String str) {
		int res = 0;
		boolean inc = false;
		if(str.equals("VV") || str.equals("KK"))
			return 1;
		for(int i=0; i<str.length()-1; i++) {
			if(str.charAt(i) == 'V' && str.charAt(i+1) == 'K'){
				res++;
			}
			else if(i<str.length()-2 && str.charAt(i+2) == 'V' && str.charAt(i+1) == 'V' && str.charAt(i) == 'V')
				inc = true;
			else if(i<str.length()-2 && str.charAt(i+2) == 'K' && str.charAt(i+1) == 'K' && str.charAt(i) == 'K')
				inc = true;
			else if(i<str.length()-2 && str.charAt(i) == 'K' && str.charAt(i+1) == 'K' && str.charAt(i+2) == 'V')
				inc = true;
		}
		if(str.length() > 1 && str.charAt(str.length()-2) == 'V' && str.charAt(str.length()-1) == 'V')
			inc = true;
		if(inc)
			return res + 1;
		else return res;
	}

	public static void f_807_b() {

		Scanner in = new Scanner(System.in);

		int p = in.nextInt();
		int x = in.nextInt();
		int y = in.nextInt();
		int myScore = x;
		int res = 0;
		while(myScore >= y) {
			if(isOk(myScore, p)) {
				res = 1;
				break;
			}
			myScore -= 50;
		}
		myScore = x;
		int i=0;
		while(res == 0) {
			myScore += 50;
			i++;
			if(isOk(myScore, p)) {
				break;
			}
		}
		if(res == 1)
			System.out.println("0");
		else
			System.out.println((i+1)/2);

	}

	public static boolean isOk(int myScore, int myRank) {
		int i = (myScore/50) % 475;
		for(int j =0 ; j<25; j++) {
			i = (i*96 + 42) % 475;
			if((i+26) == myRank)
				return true;
		}
		return false;
	}

}

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class VK{
	public static void main(String[] args)throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String s=br.readLine();
		int l=s.length();
		if(l<=1){
			System.out.println(0);
			return;
		}

		String sto[]=new String[l];
		int count=0,flag=0;
		for (int i=0;i<l-1;i++) {
			sto[i]=s.substring(i,i+2);
		}
		if(sto[0].equals("KK")){
				sto[0]="VK";
				flag=1;
		}

		if(l==2 && sto[0].equals("VV"))
			sto[0]="VK";
		for (int i=1;i<l-2; i++) {
			if(flag==0)
				if(!sto[i-1].equals("VK") && (sto[i].equals("VV") || sto[i].equals("KK")) && !sto[i+1].equals("VK")){
					sto[i]="VK";
					flag=1;
				}
			/*if(sto[i].equals("VK")){
				System.out.println(sto[i]);
				count++;
			}*/
		}
		if(flag==0 && sto[l-2].equals("VV"))
			sto[l-2]="VK";

		for (int i=0;i<l-1;i++) {
			if(sto[i].equals("VK"))
				count++;
		}
		/*if(sto[0].equals("VK"))
			count++;
		if(l<2)
			if(sto[l-2].equals("VK"))
				count++;

		if(flag==1)
			count++;
		*/
		System.out.println(count);

	}
}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
import java.util.HashSet;

public class Crew {

    public static void main(String[] args) {
        Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));

        String s = sc.next();

        char[] a = s.toCharArray();

        int count = 0;
        int z = 0;

         for (int i = 0; i < a.length - 1; i++) {
            if (a[i] == 'V' && a[i + 1] == 'K') {
                count++;
                a[i]=a[i+1]='-';

            }
        }
         for (int i = 0; i < a.length - 1; i++) {
            if (a[i] == 'V' && a[i + 1] == 'V'||a[i] == 'K' && a[i + 1] == 'V') {
                count++;
                a[i]=a[i+1]='-';
                break;

            }
        }
        System.out.println(count);

    }

}

import java.io.*;
import java.util.StringTokenizer;

public class Main {

	public static FastScanner in = new FastScanner(System.in);
	public static PrintWriter pw = new PrintWriter(System.out);

	public static class FastScanner {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public FastScanner(InputStream i) {
			reader = new BufferedReader(new InputStreamReader(i));
			tokenizer = new StringTokenizer("");
		}

		public String next() throws IOException {
			while (!tokenizer.hasMoreTokens())
				tokenizer = new StringTokenizer(reader.readLine());
			return tokenizer.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public void close() throws IOException {
			reader.close();
		}
	}

	public static void main(String[] args) {
		try {
			String t = in.next();
			int nbVk = 0;
			int oneAdd = 0;
			for (int i = 0; i < t.length() - 1; i++) {
				if (t.charAt(i) == 'V' && t.charAt(i + 1) == 'K') {
					nbVk++;
					i++;
				} else if (oneAdd == 0) {
					oneAdd = 1;
					if (t.charAt(i) == 'V' || t.charAt(i+1) == 'K')
						i++;
				}
			}
			System.out.println(nbVk + oneAdd);
			in.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}

import java.util.Scanner;
import java.util.TreeMap;

public class NewClass {

    public static void main(String ar[])
    {

                Scanner s = new Scanner(System.in);
                String str=s.nextLine();
                int count=0;
                if(str.length()==1)
                    count=0;

                if(str.equalsIgnoreCase("VV") && str.equalsIgnoreCase("VV"))
                    count++;

                if(str.contains("KKK"))
                str.replaceFirst("KKK","KVK");

                else if(str.contains("VVV"))
                str.replaceFirst("VVV","VKV");

                for(int i=0;i<str.length()-1;i++)
                    {
                        if(str.charAt(i)=='V' && str.charAt(i+1)=='K')
                            count++;
                    }

         System.out.println(count);

    }
}

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder input = new StringBuilder(br.readLine());

		boolean altered = false;
		int count = 0;
		int i = 0;
		while(i<input.length()-1) {
			if(input.charAt(i) == 'V') {
				if(input.charAt(i+1) == 'K') {
					++count;
					++i;
				} else {
					if(!altered) {
						input.setCharAt(i+1, 'K');
						++count;
						++i;

						altered = true;
					}
				}
			} else {
				if(input.charAt(i+1) == 'K') {
					if(!altered) {
						input.setCharAt(i, 'V');
						++count;
						++i;

						altered = true;
					}
				}
			}

			++i;
		}

		System.out.println(count);
	}
}

import java.util.Scanner;

public class ViciousKeyboard {
	public static void main(String [] args){
		Scanner sc = new Scanner(System.in);
		String Test = sc.next();
		sc.close();
		int Counter = 0 ;
		boolean Possible1 = false ;
		for(int i = 0 ; i < Test.length()-1 ; i ++){
			if(Test.charAt(i) == 'V' && Test.charAt(i+1) =='K'){
				Counter ++ ;}
			if(Test.charAt(i) == 'V' && Test.charAt(i+1) =='V'){
				Possible1 = true ;}}
		if(Possible1)
			Counter ++ ;
		System.out.println(Counter);
		}
}

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
// package vicious.keyboard;

import java.util.Scanner;

/**
 *
 * @author Mostafa
 */
public class ViciousKeyboard {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner in = new Scanner(System.in);
        String s = in.next() ;
        byte n = 0 , v = 0 ;
        for ( int i = 0 ; i < s.length() - 1 ; ++i )
            if ( s.charAt(i) == 'V' && s.charAt(i+1) == 'K' )
                ++n ;
            else if ( s.charAt(i) == 'V' && s.charAt(i+1) == 'V'  )
                ++v ;
        if ( v > 0 )
            ++n ;
        System.out.println(n);
    }

}

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;

public class TaskA
{
	public static void main(String[] args)
	{
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(System.out);
		Solver solver = new Solver(in, out);

		solver.solve();
		in.close();
		out.flush();
		out.close();
	}

	static class Solver
	{
		InputReader in;
		PrintWriter out;

		void solve()
		{
			String line = in.nextLine();
			int len = line.length();
			int cnt = 0;
			int vv = 0;

			for (int i = 0; i < len - 1; i++)
			{
				if (line.charAt(i) == 'V' && line.charAt(i + 1) == 'K')
					cnt++;
				else if (line.charAt(i) == 'V' && line.charAt(i + 1) == 'V' && ((i < len - 2 && line.charAt(i + 2) ==
						'V') || (i >= len - 2)))
					vv++;
			}

			if (vv > 0)
				vv = 1;

			out.println(cnt + vv);
		}

		public Solver(InputReader in, PrintWriter out)
		{
			this.in = in;
			this.out = out;
		}

	}

	static class InputReader
	{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public InputReader(InputStream stream)
		{
			this.stream = stream;
		}

		public int read()
		{
			if (numChars == -1)
				throw new InputMismatchException();

			if (curChar >= numChars)
			{
				curChar = 0;
				try
				{
					numChars = stream.read(buf);
				} catch (IOException e)
				{
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}

			return buf[curChar++];
		}

		public int nextInt()
		{
			int c = read();

			while (isSpaceChar(c))
				c = read();

			int sgn = 1;

			if (c == '-')
			{
				sgn = -1;
				c = read();
			}

			int res = 0;

			do
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();

				res *= 10;
				res += c & 15;

				c = read();
			} while (!isSpaceChar(c));

			return res * sgn;
		}

		public int[] nextIntArray(int arraySize)
		{
			int array[] = new int[arraySize];

			for (int i = 0; i < arraySize; i++)
				array[i] = nextInt();

			return array;
		}

		public long nextLong()
		{
			int c = read();

			while (isSpaceChar(c))
				c = read();

			int sign = 1;

			if (c == '-')
			{
				sign = -1;

				c = read();
			}

			long result = 0;

			do
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();

				result *= 10;
				result += c & 15;

				c = read();
			} while (!isSpaceChar(c));

			return result * sign;
		}

		public long[] nextLongArray(int arraySize)
		{
			long array[] = new long[arraySize];

			for (int i = 0; i < arraySize; i++)
				array[i] = nextLong();

			return array;
		}

		public float nextFloat()
		{
			float result, div;
			byte c;

			result = 0;
			div = 1;
			c = (byte) read();

			while (c <= ' ')
				c = (byte) read();

			boolean isNegative = (c == '-');

			if (isNegative)
				c = (byte) read();

			do
			{
				result = result * 10 + c - '0';
			} while ((c = (byte) read()) >= '0' && c <= '9');

			if (c == '.')
				while ((c = (byte) read()) >= '0' && c <= '9')
					result += (c - '0') / (div *= 10);

			if (isNegative)
				return -result;

			return result;
		}

		public double nextDouble()
		{
			double ret = 0, div = 1;
			byte c = (byte) read();

			while (c <= ' ')
				c = (byte) read();

			boolean neg = (c == '-');

			if (neg)
				c = (byte) read();

			do
			{
				ret = ret * 10 + c - '0';
			} while ((c = (byte) read()) >= '0' && c <= '9');

			if (c == '.')
				while ((c = (byte) read()) >= '0' && c <= '9')
					ret += (c - '0') / (div *= 10);

			if (neg)
				return -ret;

			return ret;
		}

		public String next()
		{
			int c = read();

			while (isSpaceChar(c))
				c = read();

			StringBuilder res = new StringBuilder();

			do
			{
				res.appendCodePoint(c);

				c = read();
			} while (!isSpaceChar(c));

			return res.toString();
		}

		public boolean isSpaceChar(int c)
		{
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String nextLine()
		{
			int c = read();

			StringBuilder result = new StringBuilder();

			do
			{
				result.appendCodePoint(c);

				c = read();
			} while (c != -1 && !isNewLine(c));

			return result.toString();
		}

		public boolean isNewLine(int c)
		{
			return c == '\n';
		}

		public void close()
		{
			try
			{
				stream.close();
			} catch (IOException e)
			{
				e.printStackTrace();
			}
		}

	}

	public TaskA(InputStream inputStream, OutputStream outputStream)
	{
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		Solver solver = new Solver(in, out);

		solver.solve();
		in.close();
		out.flush();
		out.close();
	}

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.io.BufferedReader;

public class fstclass {

	public static void main(String[] args) {
		InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        String s = in.next();
        int cnt = 0;
        boolean [] a = new boolean[1000];

        for(int i = 0; i < s.length(); i ++) {
        	char x = s.charAt(i);
        	if(x == 'K') {
        		if(i != 0 && s.charAt(i - 1) == 'V') {
        			cnt ++;
        			a[i] = a[i + 1] = true;
        			i ++;
        		}
        	}
        }
        for(int i = 1; i < s.length(); i ++) {
        	if(a[i] && a[i - 1]) {
        		cnt ++;
        		break;
        	}
        }
        System.out.print(cnt);
	}

	static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }

}

import java.io.*;
import java.util.*;
import java.math.*;

public class _409div2Q1
{
    public static void main(String[] args) throws IOException
    {
        FastScanner obj = new FastScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));
      	String str = obj.next();
      	int l = str.length();

      	if(l==1)
      		out.print(0);
		else if(l==2)
		{
			if(str.equals("KV"))
				out.print(0);
			else
				out.print(1);
		}
      	else
      	{
      		int ans = 0;
      		int flag = 0;
      		for(int i=0;i<l-1;i++)
      		{
      			char c = str.charAt(i);
      			char c2 = str.charAt(i+1);
      			String s = "";
      			s += c;
      			s += c2;

      			if(s.equals("VK"))
      			{
      				ans++;
      				i++;
      			}
      			else if(flag==0)
      			{
      				if(!s.equals("KV"))
      				{
      					ans++;
      					flag=1;
      					i++;
      				}
      			}
//      			System.out.println(s+" "+ans);

      		}
      		out.print(ans);
      	}
        out.close();
   }

   //-----------PrintWriter for faster output---------------------------------
   public static PrintWriter out;

   //-----------FastScanner class for faster input----------
   public static class FastScanner {
        BufferedReader br;
        StringTokenizer tokenizer;

        public FastScanner() throws IOException {
            br = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = new StringTokenizer(br.readLine().trim());
        }

        String next() {
            while (tokenizer == null || !tokenizer.hasMoreElements()) {
                try {
                    tokenizer = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                    }
            }
          return tokenizer.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        int[] nextIntArray() throws IOException {
            String[] line = br.readLine().trim().split(" ");
            int[] out = new int[line.length];

            for (int i = 0; i < line.length; i++) {
                out[i] = Integer.valueOf(line[i]);
            }
            return out;
        }

        BigInteger nextBigInteger() throws IOException {
            return new BigInteger(next());
        }

        String nextLine(){
            String str = "";
	        try {
	            str = br.readLine();
	        } catch (IOException e) {
	            e.printStackTrace();
	        }
	        return str;
        }

   }
   //--------------------------------------------------------
}

import java.util.Scanner;

public class JavaApplication1 {

    public static void main(String[] args) {

       // System.out.println("hello");\
       Scanner s=new Scanner(System.in);
       String str=s.next();
       int count=0;
       for(int i=0;i<str.length()-1;i++)
       {
           if(str.charAt(i)=='V' && str.charAt(i+1)=='K')
               count++;
       }

       if(str.length()==1)
           System.out.println("0");
       else if(str.length()==2)
       {
           if(str.equalsIgnoreCase("vk"))
               System.out.println("1");
           else
               System.out.println("0");
       }
       else
       {
           if(str.contains("VVV"))
               System.out.println(count+1);
           else if(str.contains("KKK"))
               System.out.println(count+1);
           else System.out.println(count);
       }

    }

}

import java.io.*;
import java.util.StringTokenizer;

public class Main {

	public static FastScanner in = new FastScanner(System.in);
	public static PrintWriter pw = new PrintWriter(System.out);

	public static class FastScanner {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public FastScanner(InputStream i) {
			reader = new BufferedReader(new InputStreamReader(i));
			tokenizer = new StringTokenizer("");
		}

		public String next() throws IOException {
			while (!tokenizer.hasMoreTokens())
				tokenizer = new StringTokenizer(reader.readLine());
			return tokenizer.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public void close() throws IOException {
			reader.close();
		}
	}

	public static void main(String[] args) {
		try {
			String t = in.next();
			int nbVk = 0;
			int oneAdd = 0;
			for (int i = 0; i < t.length() - 1; i++) {
				if (t.charAt(i) == 'V' && t.charAt(i + 1) == 'K') {
					nbVk++;
					i++;
				} else if (oneAdd == 0) {
					if (t.charAt(i) == 'V' || t.charAt(i + 1) == 'K') {
						i++;
						oneAdd = 1;
					}
				}
			}
			System.out.println(nbVk + oneAdd);
			in.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}

import java.util.Scanner;

public class ViciousKeyboard {

    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.println(getTimesOfVK(scanner.next()));
    }
    public static int getTimesOfVK(String text){
        StringBuilder stringBuilder=new StringBuilder(text);
        int counter=0;
        while(stringBuilder.toString().contains("VK")){
            counter++;
            int position=stringBuilder.toString().indexOf("VK");
            stringBuilder.replace(position, position+2, "##");
        }
        if(stringBuilder.toString().contains("VV")||stringBuilder.toString().contains("KK")) counter++;
        System.out.println(stringBuilder);
        return counter;
    }
}

import java.util.*;
import java.lang.String;
public class Viceous
{
	static Scanner sc = new Scanner(System.in);
	public static void main(String [] args)throws Exception{
	String str=sc.next();
	int count=0;
	boolean flag=false;
	for(int i=0;i<str.length()-1;i++){
	if(str.charAt(i)=='V' && str.charAt(i+1)=='K')
		count++;
	else if(str.length()>2 && str.charAt(i)=='V' && str.charAt(i+1)=='V' && str.charAt(i+2)!='K')
		flag=true;
	else if(str.length()==2 && str.charAt(i)=='V' && str.charAt(i+1)=='V' )
		flag=true;
	}
	if(flag)
		System.out.println(count+1);
	else
		System.out.println(count);
	}
}

import java.util.Scanner;

public class HarmfulKeyboard {

	public static void main(String[] args) throws Exception {
		Scanner in = new Scanner(System.in);
		String inStr = in.nextLine();
		in.close();

		int maxOccurrence = 0;

		if (inStr.length() > 1) {
			for (int i = 0; i < inStr.length() - 1; i++) {
				String s0 = String.valueOf(inStr.charAt(i));
				String s1 = String.valueOf(inStr.charAt(i + 1));

				if ((s0 + s1).equals("VK")) {
					maxOccurrence += 1;
				}
			}

			for (int i = 0; i < inStr.length() - 3; i++) {
				String s0 = String.valueOf(inStr.charAt(i));
				String s1 = String.valueOf(inStr.charAt(i + 1));
				String s2 = String.valueOf(inStr.charAt(i + 2));
				String s3 = String.valueOf(inStr.charAt(i + 3));

				if ((s0 + s1 + s2 + s3).equals("VKKK") || (s0 + s1 + s2 + s3).equals("KVVV")) {
					System.out.println(maxOccurrence + 1);
					return;
				}
			}

			for (int i = 0; i < inStr.length() - 1; i++) {
				String s0 = String.valueOf(inStr.charAt(i));
				String s1 = String.valueOf(inStr.charAt(i + 1));

				if ((s0 + s1).equals("KK") || (s0 + s1).equals("VV")) {
					System.out.println(maxOccurrence + 1);
					return;
				}
			}
		}

		System.out.println(maxOccurrence);
	}
}

import java.util.Scanner;
import java.util.StringTokenizer;

public class A2 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String  q = sc.nextLine();
		int m = 0;
		for (int i = 0;i < q.length();i++){
			switch(q.charAt(i)){
			case 'V':
				m = Math.max(m, count(q.substring(0, i)+"K"+q.substring(i+1)));
				break;
			case 'K':
				m = Math.max(m, count(q.substring(0, i)+"K"+q.substring(i+1)));
				break;
			}

		}
		System.out.println(m);
	}
	public static int count(String str){
		String findStr = "VK";
		int lastIndex = 0;
		int count = 0;

		while(lastIndex != -1){

		    lastIndex = str.indexOf(findStr,lastIndex);

		    if(lastIndex != -1){
		        count ++;
		        lastIndex += findStr.length();
		    }
		}
		return count;
	}
}

import java.util.Scanner;

/**
 * Created by alexwu on 2017/5/4.
 */
public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String input = sc.next();

        int flag = 0;
        int pos = 0;
        int ans = 0;
        for (int i = 0; i < input.length(); ) {
            if (i+1 < input.length() && input.charAt(i) == 'V' && input.charAt(i + 1) == 'K') {
                i += 2;
                ans++;
                pos = ans;
            } else if (i > pos && input.charAt(i) == input.charAt(i-1)) {
                flag = 1;
                i += 2;
            } else i++;
        }

        System.out.println(ans + flag);
    }
}

import java.util.Scanner;
import java.util.StringTokenizer;

public class A2 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String  q = sc.nextLine();
		boolean used = false;
		int prev= -1;
		int occ = 0;

		for (int i = 0;i<q.length();i++){
			switch(q.charAt(i)){
			case 'V':

				if (prev == 0 && !used){
					occ += 1;
					used = true;
					prev = 1;
					break;
				}
				prev = 0;
				break;
			case 'K':
				if (prev == 0){
					occ += 1;
					prev = 1;
				}
				else if(prev == 2){
					if (!used){
						occ += 1;
						used =true;
						prev = 1;
					}
					else{
						prev = 1;
					}
				}
				break;
			default:
				if (prev == 0 && !used){
					occ += 1;
					used = true;
				}
				prev = 2;
				break;
			}
		}
		System.out.println(prev);
	}
}

import java.util.Scanner;
import java.util.StringTokenizer;

public class A {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		char[] input = scan.nextLine().toCharArray();
		if (input.length == 1) { System.out.println(0); return; }
		int ans = 0;
		for (int i=0; i<input.length-1; i++) {
			if (input[i] == 'V' && input[i+1] == 'K') {
				ans++;
				input[i] = '*';
				input[i+1] = '*';
			}

		}
		//System.out.println(ans + printArray(input));
		if (input[0] == 'V' && input[1] != '*') {
			ans++;
		} else {
			for (int i=1; i<input.length-1; i++){
				if (input[i] == 'V' && input[i+1] != '*'){
					ans++;
					break;
				}
				if (input[i] == 'K' && input[i-1] != '*'){
					ans++;
					break;
				}
			}
		}
		System.out.println(ans);

	}

	public static String printArray(char[] temp) {
		String input = "[";
		for (int i=0; i<temp.length; i++) {
			input += temp[i] + " ";
		}
		input += "]";
		return input;
	}

}

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class viciousKeyboard {

	public static void main(String[] args) throws IOException {

		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		String str = f.readLine();

		int c = 0;
		boolean add= false;

		if (str.length() == 1){

			c = 0;

		}else{

			for (int i = 0; i < str.length(); i++){
				if (i != str.length()-1 && str.charAt(i) == 'V' && str.charAt(i+1) == 'K'){
					c++;
				}
				if (i != str.length()-1 && i != 0 && str.charAt(i-1) == 'V' && str.charAt(i) == 'V' && str.charAt(i+1) == 'V'){
					add = true;
				}
				if (i == str.length()-1 && str.charAt(i-1) == 'V' && str.charAt(i) == 'V'){
					add = true;
				}
				if (i != str.length()-1 && i != 0 && str.charAt(i-1) == 'K' && str.charAt(i) == 'K' && str.charAt(i+1) == 'K'){
					add = true;
				}
			}

			if (add){
				c++;
			}

		}

		System.out.print(c);
		System.out.close();

	}

}

import java.util.*;

public class AA {

    static Scanner in = new Scanner(System.in);
    static String S;

    public static void main(String[] args) {
        S = in.next();
        String aux = "";
        int max = OccVK(), inter;
        if (S.length() == 1) {
            System.out.println("0");
        } else {
            for (int i = 0; i < S.length(); i++) {
                aux = S;
                if (aux.charAt(i) == 'V') {
                    aux = aux.substring(0, i) + "K" + aux.substring(i + 1);
                    inter = OccVK(aux);
                    max = (inter > max) ? inter : max;
                }
            }
            System.out.println(max);
        }
    }

    static int OccVK() {
        String aux = S;
        int count = 0, i = 0, j = 1;
        while (j < S.length() - 1) {
            if (S.charAt(i) == 'V' && S.charAt(j) == 'K') {
                count++;
            }
            i++;
            j++;
        }
        return count;
    }

    static int OccVK(String aux) {
        int count = 0, i = 0, j = 1;
        while (j < aux.length()) {
            if (aux.charAt(i) == 'V' && aux.charAt(j) == 'K') {
                count++;
            }
            i++;
            j++;
        }
        return count;
    }
}

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {

        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        int num = 0;
        List <Integer> failedPositions = new ArrayList<>();

        boolean isPrevSucc = false;
        int curPos = 0;
        while (curPos < s.length())
        {
            if (curPos == s.length() - 1)
            {
                if (!isPrevSucc)
                    failedPositions.add(curPos);
                break;
            }
            if (s.charAt(curPos) == 'V' && s.charAt(curPos + 1) == 'K')
            {
                num++;
                isPrevSucc = true;
                curPos += 2;
            }
            else {
                if (!isPrevSucc)
                    failedPositions.add(curPos);
                curPos++;
                isPrevSucc = false;
            }
        }
        for (int i = 0; i < failedPositions.size() - 1; i++) {
            if (failedPositions.get(i) + 1 == failedPositions.get( i + 1) && !(s.charAt(failedPositions.get(i))  == 'K' && s.charAt(failedPositions.get(i + 1)) == 'V'))
            {
                System.out.println(++num);
                return;
            }
        }
        System.out.println(num);

    }
}

import java.util.Scanner;

/**
 *
 * @author Hindwar
 */
public class Vk {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner s = new Scanner(System.in);
        String vk = s.next();
        int prev = -1;
        int count = 0;
        while(vk.indexOf("VK", prev+1) != -1){
            count++;
            prev = vk.indexOf("VK", prev+1);
        }
	if(vk.indexOf("VV") == vk.length()-2)
                System.out.println(count+1);
        else if(vk.contains("VVV"))
            System.out.println(count+1);
        else
            System.out.println(count);
    }

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Abdulrahman Mubarak
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader input, PrintWriter out) {
            String s = input.next();
            int count = 0;
            if (s.length() < 2) {
                out.println(0);
                return;
            } else if (s.length() == 2) {
                if (!s.contains("V")) {
                    out.println(1);
                    return;
                } else if (!s.contains("K")) {
                    out.println(1);
                    return;
                } else {
                    if (s.startsWith("K")) {
                        out.print(0);
                    } else {
                        out.println(1);
                    }
                }
            }
//        int i = 0;
//        for (; i < ch.length; i++) {
//            if (ch[i] == 'V') {
//                if (i + 1 < ch.length && ch[i + 1] == 'K') {
//                    count++;
//                    i++;
//                }else if (i + 1 < ch.length && ch[i + 1] == 'V'){
//                    count++;
//                    ch[i + 1] = 'K';
//                    i++;
//                    break;
//                }
//            } else {
//                if (i >= 2) {
//                    if (i - 2 >= 0 && ch[i - 1] == 'K' && ch[i - 2] == 'K'){
//                        count++;
//                        ch[i - 1] = 'V';
//                        i++;
//                        break;
//                    }
//                } else {
//                    if (i - 1 >= 0 && ch[i - 1] == 'K') {
//                        count++;
//                        ch[i - 1] = 'V';
//                        i++;
//                        break;
//                    }
//                }
//            }
//        }

            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) == 'V') {
                    if (i + 1 < s.length() && s.charAt(i + 1) == 'K') {
                        count++;
                        i++;
                    }
                }
            }

            if (s.contains("VVV") || s.contains("KKK")) count++;
            out.println(count);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

    }
}

import java.util.Scanner;

/**
 *
 * @author Hindwar
 */
public class Vk {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner s = new Scanner(System.in);
        String vk = s.next();
        int prev = -1;
        int count = 0;
        while(vk.indexOf("VK", prev+1) != -1){
            count++;
            prev = vk.indexOf("VK", prev+1);
        }
	if(vk.contains("VV")){
            if(vk.indexOf("VV") == vk.length()-2)
                System.out.println(count+1);
        }else if(vk.contains("VVV"))
            System.out.println(count+1);
        else
            System.out.println(count);
    }

}

import java.util.Scanner;

public class ViciousKeyboard {

    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.println(getTimesOfVK(scanner.next()));
    }
    public static int getTimesOfVK(String text){
        StringBuilder stringBuilder=new StringBuilder(text);
        int counter=0;
        boolean isCharacterChangedHappend=false;
        for(int index=0;index<text.length()-1;index++){
            if((stringBuilder.length()==1)||(stringBuilder.length()==0)) break;
            char firstChar=stringBuilder.charAt(0),secondChar=stringBuilder.charAt(1);
            if((firstChar=='V')&&(secondChar=='K')) {
                counter++;
                stringBuilder=stringBuilder.delete(0,2);
            }
            else if((firstChar==secondChar)&&(!isCharacterChangedHappend)){
                isCharacterChangedHappend=true;
                counter++;
                stringBuilder=stringBuilder.delete(0,2);
            }
            else
                stringBuilder=stringBuilder.deleteCharAt(0);
        }
        return counter;
    }
}

import java.util.*;
public class AA {
    static Scanner in = new Scanner(System.in);
    static String S;
    public static void main(String[] args) {
        S = in.next();
        if(S.length()==1){
            System.out.println("0");
        }else{
            if(S.contains("VV")&&S.contains("KK")){
                System.out.println(OccVK()+1);
            }else{
                System.out.println(OccVK());
            }
        }
    }
    static int OccVK(){
        String aux = S;
        int count = 0;
        while(aux.contains("VK")){
            aux=aux.substring(0,aux.indexOf("VK"))+aux.substring(aux.indexOf("VK")+2);
            count++;
        }
        return count;
    }
}

import java.util.Scanner;

public class HarmfulKeyboard {

	public static void main(String[] args) throws Exception {
		Scanner in = new Scanner(System.in);
		String inStr = in.nextLine();
		in.close();

		int maxOccurrence = inStr.equals("VK") ? 1 : 0;

		for (int r = 0; r < inStr.length() - 1; r++) {
			int maxVarOccurrence = 0;

			for (int i = 0; i < inStr.length() - 1; i++) {
				String curStr = String.valueOf(inStr.charAt(i));
				String nextStr = String.valueOf(inStr.charAt(i + 1));

				if (i == r) {
					nextStr = inStr.charAt(i + 1) == 75 ? "V" : "K";
				}

				if (i - 1 == r) {
					curStr = inStr.charAt(i) == 75 ? "V" : "K";
				}

				if ((curStr + nextStr).equals("VK")) {
					maxVarOccurrence += 1;
				}
			}

			if (maxVarOccurrence > maxOccurrence) {
				maxOccurrence = maxVarOccurrence;
			}
		}

		System.out.println(maxOccurrence);
	}
}

/**************************************************\
   |            |   |-----------|   |-----------||
   |            |   |               	  |		 |
   |            |   |                     |      |
   |------------|   |------|              |      |
   |            |   |               	  |	     |
   |            |   |                	  |	     |
   |            |   |-----------|   	  |		 |
    				             				 |
    DA-IICT, Gandhinagar                         |
 **************************************************/

import java.io.*;
import java.util.*;
import java.util.concurrent.SynchronousQueue;

public class Main{

	public static InputReader in;
	public static PrintWriter w;

	public static void main(String[] args) {
		new Thread(null, new Runnable() {
			public void run() {
				try{
					solve();
					w.flush();
					w.close();
				}
				catch(Exception e){
					e.printStackTrace();
				}
			}
		}, "1", 1 << 26).start();
	}
	static void solve(){
		in = new InputReader(System.in);
		w = new PrintWriter(System.out);
		StringBuilder str=new StringBuilder(in.readString());
		int cnt=0;
		boolean flag=false;
		for(int i=0;i<str.length()-1;i++){
			if(str.charAt(i)=='V' && str.charAt(i+1)=='K'){
				cnt++;
				str.replace(i, i+1, "**");
				i++;
			}
		}
		for(int i=0;i<str.length()-1;i++){
			if((str.charAt(i)=='V' && str.charAt(i+1)=='V' )||(str.charAt(i)=='K' && str.charAt(i+1)=='K' )){
				cnt++;
				break;
			}
		}
		w.println(cnt);
		w.close();
	}

	static class InputReader {

		private InputStream stream;
		private byte[] buf = new byte[8192];
		private int curChar, snumChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int snext() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public long nextLong() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int[] nextIntArray(int n) {
			int a[] = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public String readString() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = snext();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}
}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
import java.util.HashSet;

public class Crew {

    public static void main(String[] args) {
        Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));

        String s = sc.next();

        char[] a = s.toCharArray();

        int count = 0;
        int z = 0;

         for (int i = 0; i < a.length - 1; i++) {
            if (a[i] == 'V' && a[i + 1] == 'K') {
                count++;
                a[i]=a[i+1]='-';

            }
        }
         for (int i = 0; i < a.length - 1; i++) {
            if (a[i] == 'V' && a[i + 1] == 'V'||a[i] == 'K' && a[i + 1] == 'V') {
                count++;
                a[i]=a[i+1]='-';
                break;

            }
        }
        System.out.println(count);

    }

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            String s = in.next();
            int cnt = 0;
            int change = 0;
            for (int i = 0; i < s.length() - 1; i++) {
                if (s.substring(i, i + 2).equals("VK")) cnt++;
                else if (s.charAt(i) == 'V' || s.charAt(i + 1) == 'K') change = 1;
            }
            out.println(cnt + change);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class A {

    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String s = br.readLine();
            boolean lastv = s.charAt(0) == 'V';
            int[] n = new int[100];
            int idx = 0;
            n[idx] = 1;
            int ans = 0;
            for (int i = 1; i < s.length(); ++i) {
                if ((lastv && s.charAt(i) != 'V') || (!lastv && s.charAt(i) == 'V')) {
                    idx++;
                }
                lastv = s.charAt(i) == 'V';
                n[idx]++;
                if (n[idx] > 2) {
                    ans = 1;
                }
            }
            if (s.charAt(0) == 'V') {
                idx++;
            }else if(n[0] == 2){
                ans++;
            }
            ans += idx / 2;
            if (s.length() == 2) {
                ans = 1;
            }
            System.out.println(ans);
        } catch (IOException ex) {
        }
    }
}

import java.util.*;
public class viciousKeyBoard
{
	public static void main(String[] args)
	{
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		if(s.length()==1)
		{
			System.out.println("0");
		}

		if(s.length()==2)
		{
			if(s.charAt(0)=='K' && s.charAt(1)=='V')
			{
				System.out.println("0");
			}
			else
			{
				System.out.println("1");
			}
		}

		if(s.length()>2)
		{
			int count=0;
			char ch[]=s.toCharArray();
			char ch1[]=s.toCharArray();

			for(int i=0;i<ch.length-2;i++)
			{
				if(ch[i]=='V' && ch[i]==ch[i+1] && ch[i+2]!='K')
				{
					ch[i+1]='K';
					break;
				}
			}

				for(int i=s.length()-1;i>1;i--)
				{
					if(ch1[i]=='K' && ch1[i]==ch1[i-1] && ch1[i-2]!='V' )
					{
						ch1[i-1]='V';
						break;
					}
				}

//
//				for(int i=0;i<ch.length;i++)
//				{
//					System.out.print(ch[i]+" ");
//				}
//
//				System.out.println();
//
//
//				for(int i=0;i<ch.length;i++)
//				{
//					System.out.print(ch1[i]+" ");
//				}
//
//				System.out.println();
//

			count=0;
			int count1=0;
			for(int i=0;i<ch.length-1;i++)
			{
				if(ch[i]=='V' && ch[i+1]=='K')
				{
					count++;
				}
			}

			for(int i=0;i<ch1.length-1;i++)
			{
				if(ch1[i]=='V' && ch1[i+1]=='K')
				{
					count1++;
				}
			}

			System.out.println(Math.max(count, count1));
		}
	}
}

import java.util.Scanner;
import java.util.regex.Pattern;

public class vicious_keyboard {
public static void main (String args[])
{
	Scanner s=new Scanner(System.in);

	String n=new String();
	n=s.nextLine();
    int count=0;
    int max=0;
    String temp=n;
    s.close();
    for (int j=0;j<n.length();j++)
    {

    	if (n.charAt(j)=='K') 	n=n.substring(0, j)+"V"+n.substring(j+1, temp.length());
    	else n=n.substring(0, j)+"K"+n.substring(j+1, temp.length());
for (int i=1;i<n.length();i++)
{
	if (n.charAt(i)=='K' && n.charAt(i-1)=='V')
		++count;
}
if (count>max) max=count;
n=temp;
count=0;
    }

System.out.println(max);

}
}