import java.util.*;

public class Main {
        public static void main(String[] args){
            Scanner sc = new Scanner(System.in);
            String s = sc.nextLine();
            int a = s.length();
            String b[] = s.split("");
            String[] comp1 = new String[a];
            String[] comp2 = new String[a];
            for(int i=0;i<a;i++) {
                comp1[i] = String.valueOf((i + 1)%2); //白スタート
                comp2[i] = String.valueOf((i)%2);
            }
            //差分比較
            int sum1=0;
            int sum2=0;
            for(int i=0;i<a;i++){
                if(!b[i].equals(comp1[i])){
                    sum1++;
                }else if(!b[i].equals(comp2[i])){
                    sum2++;
                }
            }
            int sum;
            if (sum1 < sum2) {
                sum = sum1;
            }else{
                sum = sum2;
            }
            System.out.println(sum);
        }

}
 import java.util.*; util.* java public class Main {
        public static void main(String[] args){
            Scanner sc = new Scanner(System.in);
            String s = sc.nextLine();
            int a = s.length();
            String b[] = s.split("");
            String[] comp1 = new String[a];
            String[] comp2 = new String[a];
            for(int i=0;i<a;i++) {
                comp1[i] = String.valueOf((i + 1)%2); //白スタート
                comp2[i] = String.valueOf((i)%2);
            }
            //差分比較
            int sum1=0;
            int sum2=0;
            for(int i=0;i<a;i++){
                if(!b[i].equals(comp1[i])){
                    sum1++;
                }else if(!b[i].equals(comp2[i])){
                    sum2++;
                }
            }
            int sum;
            if (sum1 < sum2) {
                sum = sum1;
            }else{
                sum = sum2;
            }
            System.out.println(sum);
        }

} Main public static void main(String[] args){
            Scanner sc = new Scanner(System.in);
            String s = sc.nextLine();
            int a = s.length();
            String b[] = s.split("");
            String[] comp1 = new String[a];
            String[] comp2 = new String[a];
            for(int i=0;i<a;i++) {
                comp1[i] = String.valueOf((i + 1)%2); //白スタート
                comp2[i] = String.valueOf((i)%2);
            }
            //差分比較
            int sum1=0;
            int sum2=0;
            for(int i=0;i<a;i++){
                if(!b[i].equals(comp1[i])){
                    sum1++;
                }else if(!b[i].equals(comp2[i])){
                    sum2++;
                }
            }
            int sum;
            if (sum1 < sum2) {
                sum = sum1;
            }else{
                sum = sum2;
            }
            System.out.println(sum);
        } main {
            Scanner sc = new Scanner(System.in);
            String s = sc.nextLine();
            int a = s.length();
            String b[] = s.split("");
            String[] comp1 = new String[a];
            String[] comp2 = new String[a];
            for(int i=0;i<a;i++) {
                comp1[i] = String.valueOf((i + 1)%2); //白スタート
                comp2[i] = String.valueOf((i)%2);
            }
            //差分比較
            int sum1=0;
            int sum2=0;
            for(int i=0;i<a;i++){
                if(!b[i].equals(comp1[i])){
                    sum1++;
                }else if(!b[i].equals(comp2[i])){
                    sum2++;
                }
            }
            int sum;
            if (sum1 < sum2) {
                sum = sum1;
            }else{
                sum = sum2;
            }
            System.out.println(sum);
        } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc int a = s.length(); a s.length() s.length s String b[] = s.split(""); b s.split("") s.split s "" String[] comp1 = new String[a]; comp1 new String[a] a String[] comp2 = new String[a]; comp2 new String[a] a for(int i=0;i<a;i++) {
                comp1[i] = String.valueOf((i + 1)%2); //白スタート
                comp2[i] = String.valueOf((i)%2);
            } int i=0; int i=0; i 0 i<a i a i++ i++ i {
                comp1[i] = String.valueOf((i + 1)%2); //白スタート
                comp2[i] = String.valueOf((i)%2);
            } {
                comp1[i] = String.valueOf((i + 1)%2); //白スタート
                comp2[i] = String.valueOf((i)%2);
            } comp1[i] = String.valueOf((i + 1)%2) comp1[i] comp1 i String.valueOf((i + 1)%2) String.valueOf String (i + 1)%2 (i + 1) i 1 2 comp2[i] = String.valueOf((i)%2) comp2[i] comp2 i String.valueOf((i)%2) String.valueOf String (i)%2 (i) 2 int sum1=0; sum1 0 int sum2=0; sum2 0 for(int i=0;i<a;i++){
                if(!b[i].equals(comp1[i])){
                    sum1++;
                }else if(!b[i].equals(comp2[i])){
                    sum2++;
                }
            } int i=0; int i=0; i 0 i<a i a i++ i++ i {
                if(!b[i].equals(comp1[i])){
                    sum1++;
                }else if(!b[i].equals(comp2[i])){
                    sum2++;
                }
            } {
                if(!b[i].equals(comp1[i])){
                    sum1++;
                }else if(!b[i].equals(comp2[i])){
                    sum2++;
                }
            } if(!b[i].equals(comp1[i])){
                    sum1++;
                }else if(!b[i].equals(comp2[i])){
                    sum2++;
                } !b[i].equals(comp1[i]) b[i].equals(comp1[i]) b[i].equals b[i] b i comp1[i] comp1 i {
                    sum1++;
                } sum1++ sum1 if(!b[i].equals(comp2[i])){
                    sum2++;
                } !b[i].equals(comp2[i]) b[i].equals(comp2[i]) b[i].equals b[i] b i comp2[i] comp2 i {
                    sum2++;
                } sum2++ sum2 int sum; sum if (sum1 < sum2) {
                sum = sum1;
            }else{
                sum = sum2;
            } sum1 < sum2 sum1 sum2 {
                sum = sum1;
            } sum = sum1 sum sum1 {
                sum = sum2;
            } sum = sum2 sum sum2 System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
        public static void main(String[] args){
            Scanner sc = new Scanner(System.in);
            String s = sc.nextLine();
            int a = s.length();
            String b[] = s.split("");
            String[] comp1 = new String[a];
            String[] comp2 = new String[a];
            for(int i=0;i<a;i++) {
                comp1[i] = String.valueOf((i + 1)%2); //白スタート
                comp2[i] = String.valueOf((i)%2);
            }
            //差分比較
            int sum1=0;
            int sum2=0;
            for(int i=0;i<a;i++){
                if(!b[i].equals(comp1[i])){
                    sum1++;
                }else if(!b[i].equals(comp2[i])){
                    sum2++;
                }
            }
            int sum;
            if (sum1 < sum2) {
                sum = sum1;
            }else{
                sum = sum2;
            }
            System.out.println(sum);
        }

} public class Main {
        public static void main(String[] args){
            Scanner sc = new Scanner(System.in);
            String s = sc.nextLine();
            int a = s.length();
            String b[] = s.split("");
            String[] comp1 = new String[a];
            String[] comp2 = new String[a];
            for(int i=0;i<a;i++) {
                comp1[i] = String.valueOf((i + 1)%2); //白スタート
                comp2[i] = String.valueOf((i)%2);
            }
            //差分比較
            int sum1=0;
            int sum2=0;
            for(int i=0;i<a;i++){
                if(!b[i].equals(comp1[i])){
                    sum1++;
                }else if(!b[i].equals(comp2[i])){
                    sum2++;
                }
            }
            int sum;
            if (sum1 < sum2) {
                sum = sum1;
            }else{
                sum = sum2;
            }
            System.out.println(sum);
        }

} Main
import java.util.*;

public class Main {
        public static void main(String[] args){
            Scanner sc = new Scanner(System.in);
            String s = sc.nextLine();
            int a = s.length();
            String b[] = s.split("");
            String[] comp1 = new String[a];
            String[] comp2 = new String[a];
            for(int i=0;i<a;i++) {
                comp1[i] = String.valueOf((i + 1)%2); //白スタート
                comp2[i] = String.valueOf((i)%2);
            }
            //差分比較
            int sum1=0;
            int sum2=0;
            for(int i=0;i<a;i++){
                if(!b[i].equals(comp1[i])){
                    sum1++;
                }else if(!b[i].equals(comp2[i])){
                    sum2++;
                }
            }
            int sum;
            if (sum1 < sum2) {
                sum = sum1;
            }else{
                sum = sum2;
            }
            System.out.println(sum);
        }

}

