import java.util.*;

public class Main{

	public static void main(String[] args){
		Scanner sc =new Scanner(System.in);
		String tile = sc.next();
		//System.out.println("tile");
		String[] tilec = tile.split("");

		int counter1=0;
		int counter2=0;
		for(int i=0;i<tilec.length;i++){
			if(i%2 == 0){
				if(tilec[i].equals("0")){
					counter1++;
				}
			}else{
				if(tilec[i].equals("1")){
					counter1++;
				}
			}
		}

		for(int i=0;i<tilec.length;i++){
			if(i%2 == 0){
				if(tilec[i].equals("1") ){
					counter2++;
				}
			}else{
				if(tilec[i].equals("0") ){
					counter2++;
				}
			}
		}

		if(counter1 >= counter2){
			System.out.println(counter2);
		}else{
			System.out.println(counter1);
		}
	}
} import java.util.*; util.* java public class Main{

	public static void main(String[] args){
		Scanner sc =new Scanner(System.in);
		String tile = sc.next();
		//System.out.println("tile");
		String[] tilec = tile.split("");

		int counter1=0;
		int counter2=0;
		for(int i=0;i<tilec.length;i++){
			if(i%2 == 0){
				if(tilec[i].equals("0")){
					counter1++;
				}
			}else{
				if(tilec[i].equals("1")){
					counter1++;
				}
			}
		}

		for(int i=0;i<tilec.length;i++){
			if(i%2 == 0){
				if(tilec[i].equals("1") ){
					counter2++;
				}
			}else{
				if(tilec[i].equals("0") ){
					counter2++;
				}
			}
		}

		if(counter1 >= counter2){
			System.out.println(counter2);
		}else{
			System.out.println(counter1);
		}
	}
} Main public static void main(String[] args){
		Scanner sc =new Scanner(System.in);
		String tile = sc.next();
		//System.out.println("tile");
		String[] tilec = tile.split("");

		int counter1=0;
		int counter2=0;
		for(int i=0;i<tilec.length;i++){
			if(i%2 == 0){
				if(tilec[i].equals("0")){
					counter1++;
				}
			}else{
				if(tilec[i].equals("1")){
					counter1++;
				}
			}
		}

		for(int i=0;i<tilec.length;i++){
			if(i%2 == 0){
				if(tilec[i].equals("1") ){
					counter2++;
				}
			}else{
				if(tilec[i].equals("0") ){
					counter2++;
				}
			}
		}

		if(counter1 >= counter2){
			System.out.println(counter2);
		}else{
			System.out.println(counter1);
		}
	} main {
		Scanner sc =new Scanner(System.in);
		String tile = sc.next();
		//System.out.println("tile");
		String[] tilec = tile.split("");

		int counter1=0;
		int counter2=0;
		for(int i=0;i<tilec.length;i++){
			if(i%2 == 0){
				if(tilec[i].equals("0")){
					counter1++;
				}
			}else{
				if(tilec[i].equals("1")){
					counter1++;
				}
			}
		}

		for(int i=0;i<tilec.length;i++){
			if(i%2 == 0){
				if(tilec[i].equals("1") ){
					counter2++;
				}
			}else{
				if(tilec[i].equals("0") ){
					counter2++;
				}
			}
		}

		if(counter1 >= counter2){
			System.out.println(counter2);
		}else{
			System.out.println(counter1);
		}
	} Scanner sc =new Scanner(System.in); sc new Scanner(System.in) String tile = sc.next(); tile sc.next() sc.next sc String[] tilec = tile.split(""); tilec tile.split("") tile.split tile "" int counter1=0; counter1 0 int counter2=0; counter2 0 for(int i=0;i<tilec.length;i++){
			if(i%2 == 0){
				if(tilec[i].equals("0")){
					counter1++;
				}
			}else{
				if(tilec[i].equals("1")){
					counter1++;
				}
			}
		} int i=0; int i=0; i 0 i<tilec.length i tilec.length tilec tilec.length i++ i++ i {
			if(i%2 == 0){
				if(tilec[i].equals("0")){
					counter1++;
				}
			}else{
				if(tilec[i].equals("1")){
					counter1++;
				}
			}
		} {
			if(i%2 == 0){
				if(tilec[i].equals("0")){
					counter1++;
				}
			}else{
				if(tilec[i].equals("1")){
					counter1++;
				}
			}
		} if(i%2 == 0){
				if(tilec[i].equals("0")){
					counter1++;
				}
			}else{
				if(tilec[i].equals("1")){
					counter1++;
				}
			} i%2 == 0 i%2 i 2 0 {
				if(tilec[i].equals("0")){
					counter1++;
				}
			} if(tilec[i].equals("0")){
					counter1++;
				} tilec[i].equals("0") tilec[i].equals tilec[i] tilec i "0" {
					counter1++;
				} counter1++ counter1 {
				if(tilec[i].equals("1")){
					counter1++;
				}
			} if(tilec[i].equals("1")){
					counter1++;
				} tilec[i].equals("1") tilec[i].equals tilec[i] tilec i "1" {
					counter1++;
				} counter1++ counter1 for(int i=0;i<tilec.length;i++){
			if(i%2 == 0){
				if(tilec[i].equals("1") ){
					counter2++;
				}
			}else{
				if(tilec[i].equals("0") ){
					counter2++;
				}
			}
		} int i=0; int i=0; i 0 i<tilec.length i tilec.length tilec tilec.length i++ i++ i {
			if(i%2 == 0){
				if(tilec[i].equals("1") ){
					counter2++;
				}
			}else{
				if(tilec[i].equals("0") ){
					counter2++;
				}
			}
		} {
			if(i%2 == 0){
				if(tilec[i].equals("1") ){
					counter2++;
				}
			}else{
				if(tilec[i].equals("0") ){
					counter2++;
				}
			}
		} if(i%2 == 0){
				if(tilec[i].equals("1") ){
					counter2++;
				}
			}else{
				if(tilec[i].equals("0") ){
					counter2++;
				}
			} i%2 == 0 i%2 i 2 0 {
				if(tilec[i].equals("1") ){
					counter2++;
				}
			} if(tilec[i].equals("1") ){
					counter2++;
				} tilec[i].equals("1") tilec[i].equals tilec[i] tilec i "1" {
					counter2++;
				} counter2++ counter2 {
				if(tilec[i].equals("0") ){
					counter2++;
				}
			} if(tilec[i].equals("0") ){
					counter2++;
				} tilec[i].equals("0") tilec[i].equals tilec[i] tilec i "0" {
					counter2++;
				} counter2++ counter2 if(counter1 >= counter2){
			System.out.println(counter2);
		}else{
			System.out.println(counter1);
		} counter1 >= counter2 counter1 counter2 {
			System.out.println(counter2);
		} System.out.println(counter2) System.out.println System.out System System.out counter2 {
			System.out.println(counter1);
		} System.out.println(counter1) System.out.println System.out System System.out counter1 String[] args args public class Main{

	public static void main(String[] args){
		Scanner sc =new Scanner(System.in);
		String tile = sc.next();
		//System.out.println("tile");
		String[] tilec = tile.split("");

		int counter1=0;
		int counter2=0;
		for(int i=0;i<tilec.length;i++){
			if(i%2 == 0){
				if(tilec[i].equals("0")){
					counter1++;
				}
			}else{
				if(tilec[i].equals("1")){
					counter1++;
				}
			}
		}

		for(int i=0;i<tilec.length;i++){
			if(i%2 == 0){
				if(tilec[i].equals("1") ){
					counter2++;
				}
			}else{
				if(tilec[i].equals("0") ){
					counter2++;
				}
			}
		}

		if(counter1 >= counter2){
			System.out.println(counter2);
		}else{
			System.out.println(counter1);
		}
	}
} public class Main{

	public static void main(String[] args){
		Scanner sc =new Scanner(System.in);
		String tile = sc.next();
		//System.out.println("tile");
		String[] tilec = tile.split("");

		int counter1=0;
		int counter2=0;
		for(int i=0;i<tilec.length;i++){
			if(i%2 == 0){
				if(tilec[i].equals("0")){
					counter1++;
				}
			}else{
				if(tilec[i].equals("1")){
					counter1++;
				}
			}
		}

		for(int i=0;i<tilec.length;i++){
			if(i%2 == 0){
				if(tilec[i].equals("1") ){
					counter2++;
				}
			}else{
				if(tilec[i].equals("0") ){
					counter2++;
				}
			}
		}

		if(counter1 >= counter2){
			System.out.println(counter2);
		}else{
			System.out.println(counter1);
		}
	}
} Main
import java.util.*;

public class Main{

	public static void main(String[] args){
		Scanner sc =new Scanner(System.in);
		String tile = sc.next();
		//System.out.println("tile");
		String[] tilec = tile.split("");

		int counter1=0;
		int counter2=0;
		for(int i=0;i<tilec.length;i++){
			if(i%2 == 0){
				if(tilec[i].equals("0")){
					counter1++;
				}
			}else{
				if(tilec[i].equals("1")){
					counter1++;
				}
			}
		}

		for(int i=0;i<tilec.length;i++){
			if(i%2 == 0){
				if(tilec[i].equals("1") ){
					counter2++;
				}
			}else{
				if(tilec[i].equals("0") ){
					counter2++;
				}
			}
		}

		if(counter1 >= counter2){
			System.out.println(counter2);
		}else{
			System.out.println(counter1);
		}
	}
}