import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String[] list = s.split("");
		int b1=0,w1=0,b2=0,w2=0;
		for(int i = 0; i < list.length; i++) {
			if(i%2 != 0) {
				if(list[i].equals("0")) {
					b1++;
				}else{
					w1++;
				}
			}else {
				if(list[i].equals("0")) {
					b2++;
				}else {
					w2++;
				}
			}
		}

		if((Math.abs(list.length-b1-w2))>Math.abs(list.length-b2-w1)) {
			System.out.println(Math.abs(list.length-b2-w1));
		}else {
			System.out.println(Math.abs(list.length-b1-w2));
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String[] list = s.split("");
		int b1=0,w1=0,b2=0,w2=0;
		for(int i = 0; i < list.length; i++) {
			if(i%2 != 0) {
				if(list[i].equals("0")) {
					b1++;
				}else{
					w1++;
				}
			}else {
				if(list[i].equals("0")) {
					b2++;
				}else {
					w2++;
				}
			}
		}

		if((Math.abs(list.length-b1-w2))>Math.abs(list.length-b2-w1)) {
			System.out.println(Math.abs(list.length-b2-w1));
		}else {
			System.out.println(Math.abs(list.length-b1-w2));
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String[] list = s.split("");
		int b1=0,w1=0,b2=0,w2=0;
		for(int i = 0; i < list.length; i++) {
			if(i%2 != 0) {
				if(list[i].equals("0")) {
					b1++;
				}else{
					w1++;
				}
			}else {
				if(list[i].equals("0")) {
					b2++;
				}else {
					w2++;
				}
			}
		}

		if((Math.abs(list.length-b1-w2))>Math.abs(list.length-b2-w1)) {
			System.out.println(Math.abs(list.length-b2-w1));
		}else {
			System.out.println(Math.abs(list.length-b1-w2));
		}
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String[] list = s.split("");
		int b1=0,w1=0,b2=0,w2=0;
		for(int i = 0; i < list.length; i++) {
			if(i%2 != 0) {
				if(list[i].equals("0")) {
					b1++;
				}else{
					w1++;
				}
			}else {
				if(list[i].equals("0")) {
					b2++;
				}else {
					w2++;
				}
			}
		}

		if((Math.abs(list.length-b1-w2))>Math.abs(list.length-b2-w1)) {
			System.out.println(Math.abs(list.length-b2-w1));
		}else {
			System.out.println(Math.abs(list.length-b1-w2));
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc String[] list = s.split(""); list s.split("") s.split s "" int b1=0 b1 0 w1=0 w1 0 b2=0 b2 0 w2=0; w2 0 for(int i = 0; i < list.length; i++) {
			if(i%2 != 0) {
				if(list[i].equals("0")) {
					b1++;
				}else{
					w1++;
				}
			}else {
				if(list[i].equals("0")) {
					b2++;
				}else {
					w2++;
				}
			}
		} int i = 0; int i = 0; i 0 i < list.length i list.length list list.length i++ i++ i {
			if(i%2 != 0) {
				if(list[i].equals("0")) {
					b1++;
				}else{
					w1++;
				}
			}else {
				if(list[i].equals("0")) {
					b2++;
				}else {
					w2++;
				}
			}
		} {
			if(i%2 != 0) {
				if(list[i].equals("0")) {
					b1++;
				}else{
					w1++;
				}
			}else {
				if(list[i].equals("0")) {
					b2++;
				}else {
					w2++;
				}
			}
		} if(i%2 != 0) {
				if(list[i].equals("0")) {
					b1++;
				}else{
					w1++;
				}
			}else {
				if(list[i].equals("0")) {
					b2++;
				}else {
					w2++;
				}
			} i%2 != 0 i%2 i 2 0 {
				if(list[i].equals("0")) {
					b1++;
				}else{
					w1++;
				}
			} if(list[i].equals("0")) {
					b1++;
				}else{
					w1++;
				} list[i].equals("0") list[i].equals list[i] list i "0" {
					b1++;
				} b1++ b1 {
					w1++;
				} w1++ w1 {
				if(list[i].equals("0")) {
					b2++;
				}else {
					w2++;
				}
			} if(list[i].equals("0")) {
					b2++;
				}else {
					w2++;
				} list[i].equals("0") list[i].equals list[i] list i "0" {
					b2++;
				} b2++ b2 {
					w2++;
				} w2++ w2 if((Math.abs(list.length-b1-w2))>Math.abs(list.length-b2-w1)) {
			System.out.println(Math.abs(list.length-b2-w1));
		}else {
			System.out.println(Math.abs(list.length-b1-w2));
		} (Math.abs(list.length-b1-w2))>Math.abs(list.length-b2-w1) (Math.abs(list.length-b1-w2)) Math.abs Math list.length-b1-w2 list.length-b1-w2 list.length list list.length b1 w2 Math.abs(list.length-b2-w1) Math.abs Math list.length-b2-w1 list.length-b2-w1 list.length list list.length b2 w1 {
			System.out.println(Math.abs(list.length-b2-w1));
		} System.out.println(Math.abs(list.length-b2-w1)) System.out.println System.out System System.out Math.abs(list.length-b2-w1) Math.abs Math list.length-b2-w1 list.length-b2-w1 list.length list list.length b2 w1 {
			System.out.println(Math.abs(list.length-b1-w2));
		} System.out.println(Math.abs(list.length-b1-w2)) System.out.println System.out System System.out Math.abs(list.length-b1-w2) Math.abs Math list.length-b1-w2 list.length-b1-w2 list.length list list.length b1 w2 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String[] list = s.split("");
		int b1=0,w1=0,b2=0,w2=0;
		for(int i = 0; i < list.length; i++) {
			if(i%2 != 0) {
				if(list[i].equals("0")) {
					b1++;
				}else{
					w1++;
				}
			}else {
				if(list[i].equals("0")) {
					b2++;
				}else {
					w2++;
				}
			}
		}

		if((Math.abs(list.length-b1-w2))>Math.abs(list.length-b2-w1)) {
			System.out.println(Math.abs(list.length-b2-w1));
		}else {
			System.out.println(Math.abs(list.length-b1-w2));
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String[] list = s.split("");
		int b1=0,w1=0,b2=0,w2=0;
		for(int i = 0; i < list.length; i++) {
			if(i%2 != 0) {
				if(list[i].equals("0")) {
					b1++;
				}else{
					w1++;
				}
			}else {
				if(list[i].equals("0")) {
					b2++;
				}else {
					w2++;
				}
			}
		}

		if((Math.abs(list.length-b1-w2))>Math.abs(list.length-b2-w1)) {
			System.out.println(Math.abs(list.length-b2-w1));
		}else {
			System.out.println(Math.abs(list.length-b1-w2));
		}
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String[] list = s.split("");
		int b1=0,w1=0,b2=0,w2=0;
		for(int i = 0; i < list.length; i++) {
			if(i%2 != 0) {
				if(list[i].equals("0")) {
					b1++;
				}else{
					w1++;
				}
			}else {
				if(list[i].equals("0")) {
					b2++;
				}else {
					w2++;
				}
			}
		}

		if((Math.abs(list.length-b1-w2))>Math.abs(list.length-b2-w1)) {
			System.out.println(Math.abs(list.length-b2-w1));
		}else {
			System.out.println(Math.abs(list.length-b1-w2));
		}
	}
}