import java.util.Arrays;
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		String S = keyboard.next();
		
		String[] tile = S.split("");
		
		String Start = tile[0];
		int countG = 0;
		int countK = 0;
		
			for (int g = 0; g < tile.length; g = g+2) {
				 if (tile[g].equals(Start)) {
					 countK ++;
				 }else {
					 countG ++;
				 }
				 	if (g != tile.length - 1) {
				 		int k = g + 1;
				 if (tile[k].equals(Start)) {
					 countG ++;
				 	}else{
					 countK ++;
				 		}
				 	}
			}
			
			int kotae = 0;
			
			kotae = countG < countK ? countG : countK;
		
		System.out.println(kotae);
		keyboard.close();
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		String S = keyboard.next();
		
		String[] tile = S.split("");
		
		String Start = tile[0];
		int countG = 0;
		int countK = 0;
		
			for (int g = 0; g < tile.length; g = g+2) {
				 if (tile[g].equals(Start)) {
					 countK ++;
				 }else {
					 countG ++;
				 }
				 	if (g != tile.length - 1) {
				 		int k = g + 1;
				 if (tile[k].equals(Start)) {
					 countG ++;
				 	}else{
					 countK ++;
				 		}
				 	}
			}
			
			int kotae = 0;
			
			kotae = countG < countK ? countG : countK;
		
		System.out.println(kotae);
		keyboard.close();
	}
} Main public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		String S = keyboard.next();
		
		String[] tile = S.split("");
		
		String Start = tile[0];
		int countG = 0;
		int countK = 0;
		
			for (int g = 0; g < tile.length; g = g+2) {
				 if (tile[g].equals(Start)) {
					 countK ++;
				 }else {
					 countG ++;
				 }
				 	if (g != tile.length - 1) {
				 		int k = g + 1;
				 if (tile[k].equals(Start)) {
					 countG ++;
				 	}else{
					 countK ++;
				 		}
				 	}
			}
			
			int kotae = 0;
			
			kotae = countG < countK ? countG : countK;
		
		System.out.println(kotae);
		keyboard.close();
	} main {
		
		Scanner keyboard = new Scanner(System.in); 
		
		String S = keyboard.next();
		
		String[] tile = S.split("");
		
		String Start = tile[0];
		int countG = 0;
		int countK = 0;
		
			for (int g = 0; g < tile.length; g = g+2) {
				 if (tile[g].equals(Start)) {
					 countK ++;
				 }else {
					 countG ++;
				 }
				 	if (g != tile.length - 1) {
				 		int k = g + 1;
				 if (tile[k].equals(Start)) {
					 countG ++;
				 	}else{
					 countK ++;
				 		}
				 	}
			}
			
			int kotae = 0;
			
			kotae = countG < countK ? countG : countK;
		
		System.out.println(kotae);
		keyboard.close();
	} Scanner keyboard = new Scanner(System.in); keyboard new Scanner(System.in) String S = keyboard.next(); S keyboard.next() keyboard.next keyboard String[] tile = S.split(""); tile S.split("") S.split S "" String Start = tile[0]; Start tile[0] tile 0 int countG = 0; countG 0 int countK = 0; countK 0 for (int g = 0; g < tile.length; g = g+2) {
				 if (tile[g].equals(Start)) {
					 countK ++;
				 }else {
					 countG ++;
				 }
				 	if (g != tile.length - 1) {
				 		int k = g + 1;
				 if (tile[k].equals(Start)) {
					 countG ++;
				 	}else{
					 countK ++;
				 		}
				 	}
			} int g = 0; int g = 0; g 0 g < tile.length g tile.length tile tile.length g = g+2 g = g+2 g g+2 g 2 {
				 if (tile[g].equals(Start)) {
					 countK ++;
				 }else {
					 countG ++;
				 }
				 	if (g != tile.length - 1) {
				 		int k = g + 1;
				 if (tile[k].equals(Start)) {
					 countG ++;
				 	}else{
					 countK ++;
				 		}
				 	}
			} {
				 if (tile[g].equals(Start)) {
					 countK ++;
				 }else {
					 countG ++;
				 }
				 	if (g != tile.length - 1) {
				 		int k = g + 1;
				 if (tile[k].equals(Start)) {
					 countG ++;
				 	}else{
					 countK ++;
				 		}
				 	}
			} if (tile[g].equals(Start)) {
					 countK ++;
				 }else {
					 countG ++;
				 } tile[g].equals(Start) tile[g].equals tile[g] tile g Start {
					 countK ++;
				 } countK ++ countK {
					 countG ++;
				 } countG ++ countG if (g != tile.length - 1) {
				 		int k = g + 1;
				 if (tile[k].equals(Start)) {
					 countG ++;
				 	}else{
					 countK ++;
				 		}
				 	} g != tile.length - 1 g tile.length - 1 tile.length tile tile.length 1 {
				 		int k = g + 1;
				 if (tile[k].equals(Start)) {
					 countG ++;
				 	}else{
					 countK ++;
				 		}
				 	} int k = g + 1; k g + 1 g 1 if (tile[k].equals(Start)) {
					 countG ++;
				 	}else{
					 countK ++;
				 		} tile[k].equals(Start) tile[k].equals tile[k] tile k Start {
					 countG ++;
				 	} countG ++ countG {
					 countK ++;
				 		} countK ++ countK int kotae = 0; kotae 0 kotae = countG < countK ? countG : countK kotae countG < countK ? countG : countK countG < countK countG countK countG countK System.out.println(kotae) System.out.println System.out System System.out kotae keyboard.close() keyboard.close keyboard String[] args args public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		String S = keyboard.next();
		
		String[] tile = S.split("");
		
		String Start = tile[0];
		int countG = 0;
		int countK = 0;
		
			for (int g = 0; g < tile.length; g = g+2) {
				 if (tile[g].equals(Start)) {
					 countK ++;
				 }else {
					 countG ++;
				 }
				 	if (g != tile.length - 1) {
				 		int k = g + 1;
				 if (tile[k].equals(Start)) {
					 countG ++;
				 	}else{
					 countK ++;
				 		}
				 	}
			}
			
			int kotae = 0;
			
			kotae = countG < countK ? countG : countK;
		
		System.out.println(kotae);
		keyboard.close();
	}
} public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		String S = keyboard.next();
		
		String[] tile = S.split("");
		
		String Start = tile[0];
		int countG = 0;
		int countK = 0;
		
			for (int g = 0; g < tile.length; g = g+2) {
				 if (tile[g].equals(Start)) {
					 countK ++;
				 }else {
					 countG ++;
				 }
				 	if (g != tile.length - 1) {
				 		int k = g + 1;
				 if (tile[k].equals(Start)) {
					 countG ++;
				 	}else{
					 countK ++;
				 		}
				 	}
			}
			
			int kotae = 0;
			
			kotae = countG < countK ? countG : countK;
		
		System.out.println(kotae);
		keyboard.close();
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		String S = keyboard.next();
		
		String[] tile = S.split("");
		
		String Start = tile[0];
		int countG = 0;
		int countK = 0;
		
			for (int g = 0; g < tile.length; g = g+2) {
				 if (tile[g].equals(Start)) {
					 countK ++;
				 }else {
					 countG ++;
				 }
				 	if (g != tile.length - 1) {
				 		int k = g + 1;
				 if (tile[k].equals(Start)) {
					 countG ++;
				 	}else{
					 countK ++;
				 		}
				 	}
			}
			
			int kotae = 0;
			
			kotae = countG < countK ? countG : countK;
		
		System.out.println(kotae);
		keyboard.close();
	}
}