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

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		char[] charSet = scanner.nextLine().toCharArray();
		int len = charSet.length;

		List<Character> zeroStart = new ArrayList<Character>();
		List<Character> oneStart = new ArrayList<Character>();
		int zcnt = 0;
		int ocnt = 0;
		for(int i = 0; i < len; i++){
			zeroStart.add(Integer.toString(i%2).toCharArray()[0]);
			oneStart.add(Integer.toString((i+1)%2).toCharArray()[0]);

			if(!zeroStart.get(i).equals(charSet[i])){
				zcnt++;
			}else{
				ocnt++;
			}
		}
		int min = Math.min(zcnt, ocnt);


		System.out.println(min);
		scanner.close();
	}

} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		char[] charSet = scanner.nextLine().toCharArray();
		int len = charSet.length;

		List<Character> zeroStart = new ArrayList<Character>();
		List<Character> oneStart = new ArrayList<Character>();
		int zcnt = 0;
		int ocnt = 0;
		for(int i = 0; i < len; i++){
			zeroStart.add(Integer.toString(i%2).toCharArray()[0]);
			oneStart.add(Integer.toString((i+1)%2).toCharArray()[0]);

			if(!zeroStart.get(i).equals(charSet[i])){
				zcnt++;
			}else{
				ocnt++;
			}
		}
		int min = Math.min(zcnt, ocnt);


		System.out.println(min);
		scanner.close();
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		char[] charSet = scanner.nextLine().toCharArray();
		int len = charSet.length;

		List<Character> zeroStart = new ArrayList<Character>();
		List<Character> oneStart = new ArrayList<Character>();
		int zcnt = 0;
		int ocnt = 0;
		for(int i = 0; i < len; i++){
			zeroStart.add(Integer.toString(i%2).toCharArray()[0]);
			oneStart.add(Integer.toString((i+1)%2).toCharArray()[0]);

			if(!zeroStart.get(i).equals(charSet[i])){
				zcnt++;
			}else{
				ocnt++;
			}
		}
		int min = Math.min(zcnt, ocnt);


		System.out.println(min);
		scanner.close();
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		char[] charSet = scanner.nextLine().toCharArray();
		int len = charSet.length;

		List<Character> zeroStart = new ArrayList<Character>();
		List<Character> oneStart = new ArrayList<Character>();
		int zcnt = 0;
		int ocnt = 0;
		for(int i = 0; i < len; i++){
			zeroStart.add(Integer.toString(i%2).toCharArray()[0]);
			oneStart.add(Integer.toString((i+1)%2).toCharArray()[0]);

			if(!zeroStart.get(i).equals(charSet[i])){
				zcnt++;
			}else{
				ocnt++;
			}
		}
		int min = Math.min(zcnt, ocnt);


		System.out.println(min);
		scanner.close();
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) char[] charSet = scanner.nextLine().toCharArray(); charSet scanner.nextLine().toCharArray() scanner.nextLine().toCharArray scanner.nextLine() scanner.nextLine scanner int len = charSet.length; len charSet.length charSet charSet.length List<Character> zeroStart = new ArrayList<Character>(); zeroStart new ArrayList<Character>() List<Character> oneStart = new ArrayList<Character>(); oneStart new ArrayList<Character>() int zcnt = 0; zcnt 0 int ocnt = 0; ocnt 0 for(int i = 0; i < len; i++){
			zeroStart.add(Integer.toString(i%2).toCharArray()[0]);
			oneStart.add(Integer.toString((i+1)%2).toCharArray()[0]);

			if(!zeroStart.get(i).equals(charSet[i])){
				zcnt++;
			}else{
				ocnt++;
			}
		} int i = 0; int i = 0; i 0 i < len i len i++ i++ i {
			zeroStart.add(Integer.toString(i%2).toCharArray()[0]);
			oneStart.add(Integer.toString((i+1)%2).toCharArray()[0]);

			if(!zeroStart.get(i).equals(charSet[i])){
				zcnt++;
			}else{
				ocnt++;
			}
		} {
			zeroStart.add(Integer.toString(i%2).toCharArray()[0]);
			oneStart.add(Integer.toString((i+1)%2).toCharArray()[0]);

			if(!zeroStart.get(i).equals(charSet[i])){
				zcnt++;
			}else{
				ocnt++;
			}
		} zeroStart.add(Integer.toString(i%2).toCharArray()[0]) zeroStart.add zeroStart Integer.toString(i%2).toCharArray()[0] Integer.toString(i%2).toCharArray() Integer.toString(i%2).toCharArray Integer.toString(i%2) Integer.toString Integer i%2 i 2 0 oneStart.add(Integer.toString((i+1)%2).toCharArray()[0]) oneStart.add oneStart Integer.toString((i+1)%2).toCharArray()[0] Integer.toString((i+1)%2).toCharArray() Integer.toString((i+1)%2).toCharArray Integer.toString((i+1)%2) Integer.toString Integer (i+1)%2 (i+1) i 1 2 0 if(!zeroStart.get(i).equals(charSet[i])){
				zcnt++;
			}else{
				ocnt++;
			} !zeroStart.get(i).equals(charSet[i]) zeroStart.get(i).equals(charSet[i]) zeroStart.get(i).equals zeroStart.get(i) zeroStart.get zeroStart i charSet[i] charSet i {
				zcnt++;
			} zcnt++ zcnt {
				ocnt++;
			} ocnt++ ocnt int min = Math.min(zcnt, ocnt); min Math.min(zcnt, ocnt) Math.min Math zcnt ocnt System.out.println(min) System.out.println System.out System System.out min scanner.close() scanner.close scanner String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		char[] charSet = scanner.nextLine().toCharArray();
		int len = charSet.length;

		List<Character> zeroStart = new ArrayList<Character>();
		List<Character> oneStart = new ArrayList<Character>();
		int zcnt = 0;
		int ocnt = 0;
		for(int i = 0; i < len; i++){
			zeroStart.add(Integer.toString(i%2).toCharArray()[0]);
			oneStart.add(Integer.toString((i+1)%2).toCharArray()[0]);

			if(!zeroStart.get(i).equals(charSet[i])){
				zcnt++;
			}else{
				ocnt++;
			}
		}
		int min = Math.min(zcnt, ocnt);


		System.out.println(min);
		scanner.close();
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		char[] charSet = scanner.nextLine().toCharArray();
		int len = charSet.length;

		List<Character> zeroStart = new ArrayList<Character>();
		List<Character> oneStart = new ArrayList<Character>();
		int zcnt = 0;
		int ocnt = 0;
		for(int i = 0; i < len; i++){
			zeroStart.add(Integer.toString(i%2).toCharArray()[0]);
			oneStart.add(Integer.toString((i+1)%2).toCharArray()[0]);

			if(!zeroStart.get(i).equals(charSet[i])){
				zcnt++;
			}else{
				ocnt++;
			}
		}
		int min = Math.min(zcnt, ocnt);


		System.out.println(min);
		scanner.close();
	}

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

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		char[] charSet = scanner.nextLine().toCharArray();
		int len = charSet.length;

		List<Character> zeroStart = new ArrayList<Character>();
		List<Character> oneStart = new ArrayList<Character>();
		int zcnt = 0;
		int ocnt = 0;
		for(int i = 0; i < len; i++){
			zeroStart.add(Integer.toString(i%2).toCharArray()[0]);
			oneStart.add(Integer.toString((i+1)%2).toCharArray()[0]);

			if(!zeroStart.get(i).equals(charSet[i])){
				zcnt++;
			}else{
				ocnt++;
			}
		}
		int min = Math.min(zcnt, ocnt);


		System.out.println(min);
		scanner.close();
	}

}
