import java.util.*;

public class Main {
    public static void main(String[] args) {
 		Scanner sc = new Scanner(System.in);

    String s=sc.next();
    String ss[]=s.split("");
    int n[]=new int[ss.length];
    for(int i=0;i<ss.length;i++){
      n[i]=Integer.parseInt(ss[i]);
    }

    int count1=0;
    int count2=0;

    for(int i=0;i<n.length;i++){
      if(i%2==0){
        if(n[i]==0){
          count1++;
        }
      }else{
        if(n[i]==1){
          count1++;
        }
      }
      if(i%2==0){
        if(n[i]==1){
          count2++;
        }
      }else{
        if(n[i]==0){
          count2++;
        }
      }
    }
    

    if(count1<count2){
      System.out.println(count1);
    }else{
      System.out.println(count2);
    }


	}
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
 		Scanner sc = new Scanner(System.in);

    String s=sc.next();
    String ss[]=s.split("");
    int n[]=new int[ss.length];
    for(int i=0;i<ss.length;i++){
      n[i]=Integer.parseInt(ss[i]);
    }

    int count1=0;
    int count2=0;

    for(int i=0;i<n.length;i++){
      if(i%2==0){
        if(n[i]==0){
          count1++;
        }
      }else{
        if(n[i]==1){
          count1++;
        }
      }
      if(i%2==0){
        if(n[i]==1){
          count2++;
        }
      }else{
        if(n[i]==0){
          count2++;
        }
      }
    }
    

    if(count1<count2){
      System.out.println(count1);
    }else{
      System.out.println(count2);
    }


	}
} Main public static void main(String[] args) {
 		Scanner sc = new Scanner(System.in);

    String s=sc.next();
    String ss[]=s.split("");
    int n[]=new int[ss.length];
    for(int i=0;i<ss.length;i++){
      n[i]=Integer.parseInt(ss[i]);
    }

    int count1=0;
    int count2=0;

    for(int i=0;i<n.length;i++){
      if(i%2==0){
        if(n[i]==0){
          count1++;
        }
      }else{
        if(n[i]==1){
          count1++;
        }
      }
      if(i%2==0){
        if(n[i]==1){
          count2++;
        }
      }else{
        if(n[i]==0){
          count2++;
        }
      }
    }
    

    if(count1<count2){
      System.out.println(count1);
    }else{
      System.out.println(count2);
    }


	} main {
 		Scanner sc = new Scanner(System.in);

    String s=sc.next();
    String ss[]=s.split("");
    int n[]=new int[ss.length];
    for(int i=0;i<ss.length;i++){
      n[i]=Integer.parseInt(ss[i]);
    }

    int count1=0;
    int count2=0;

    for(int i=0;i<n.length;i++){
      if(i%2==0){
        if(n[i]==0){
          count1++;
        }
      }else{
        if(n[i]==1){
          count1++;
        }
      }
      if(i%2==0){
        if(n[i]==1){
          count2++;
        }
      }else{
        if(n[i]==0){
          count2++;
        }
      }
    }
    

    if(count1<count2){
      System.out.println(count1);
    }else{
      System.out.println(count2);
    }


	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s=sc.next(); s sc.next() sc.next sc String ss[]=s.split(""); ss s.split("") s.split s "" int n[]=new int[ss.length]; n new int[ss.length] ss.length ss ss.length for(int i=0;i<ss.length;i++){
      n[i]=Integer.parseInt(ss[i]);
    } int i=0; int i=0; i 0 i<ss.length i ss.length ss ss.length i++ i++ i {
      n[i]=Integer.parseInt(ss[i]);
    } {
      n[i]=Integer.parseInt(ss[i]);
    } n[i]=Integer.parseInt(ss[i]) n[i] n i Integer.parseInt(ss[i]) Integer.parseInt Integer ss[i] ss i int count1=0; count1 0 int count2=0; count2 0 for(int i=0;i<n.length;i++){
      if(i%2==0){
        if(n[i]==0){
          count1++;
        }
      }else{
        if(n[i]==1){
          count1++;
        }
      }
      if(i%2==0){
        if(n[i]==1){
          count2++;
        }
      }else{
        if(n[i]==0){
          count2++;
        }
      }
    } int i=0; int i=0; i 0 i<n.length i n.length n n.length i++ i++ i {
      if(i%2==0){
        if(n[i]==0){
          count1++;
        }
      }else{
        if(n[i]==1){
          count1++;
        }
      }
      if(i%2==0){
        if(n[i]==1){
          count2++;
        }
      }else{
        if(n[i]==0){
          count2++;
        }
      }
    } {
      if(i%2==0){
        if(n[i]==0){
          count1++;
        }
      }else{
        if(n[i]==1){
          count1++;
        }
      }
      if(i%2==0){
        if(n[i]==1){
          count2++;
        }
      }else{
        if(n[i]==0){
          count2++;
        }
      }
    } if(i%2==0){
        if(n[i]==0){
          count1++;
        }
      }else{
        if(n[i]==1){
          count1++;
        }
      } i%2==0 i%2 i 2 0 {
        if(n[i]==0){
          count1++;
        }
      } if(n[i]==0){
          count1++;
        } n[i]==0 n[i] n i 0 {
          count1++;
        } count1++ count1 {
        if(n[i]==1){
          count1++;
        }
      } if(n[i]==1){
          count1++;
        } n[i]==1 n[i] n i 1 {
          count1++;
        } count1++ count1 if(i%2==0){
        if(n[i]==1){
          count2++;
        }
      }else{
        if(n[i]==0){
          count2++;
        }
      } i%2==0 i%2 i 2 0 {
        if(n[i]==1){
          count2++;
        }
      } if(n[i]==1){
          count2++;
        } n[i]==1 n[i] n i 1 {
          count2++;
        } count2++ count2 {
        if(n[i]==0){
          count2++;
        }
      } if(n[i]==0){
          count2++;
        } n[i]==0 n[i] n i 0 {
          count2++;
        } count2++ count2 if(count1<count2){
      System.out.println(count1);
    }else{
      System.out.println(count2);
    } count1<count2 count1 count2 {
      System.out.println(count1);
    } System.out.println(count1) System.out.println System.out System System.out count1 {
      System.out.println(count2);
    } System.out.println(count2) System.out.println System.out System System.out count2 String[] args args public class Main {
    public static void main(String[] args) {
 		Scanner sc = new Scanner(System.in);

    String s=sc.next();
    String ss[]=s.split("");
    int n[]=new int[ss.length];
    for(int i=0;i<ss.length;i++){
      n[i]=Integer.parseInt(ss[i]);
    }

    int count1=0;
    int count2=0;

    for(int i=0;i<n.length;i++){
      if(i%2==0){
        if(n[i]==0){
          count1++;
        }
      }else{
        if(n[i]==1){
          count1++;
        }
      }
      if(i%2==0){
        if(n[i]==1){
          count2++;
        }
      }else{
        if(n[i]==0){
          count2++;
        }
      }
    }
    

    if(count1<count2){
      System.out.println(count1);
    }else{
      System.out.println(count2);
    }


	}
} public class Main {
    public static void main(String[] args) {
 		Scanner sc = new Scanner(System.in);

    String s=sc.next();
    String ss[]=s.split("");
    int n[]=new int[ss.length];
    for(int i=0;i<ss.length;i++){
      n[i]=Integer.parseInt(ss[i]);
    }

    int count1=0;
    int count2=0;

    for(int i=0;i<n.length;i++){
      if(i%2==0){
        if(n[i]==0){
          count1++;
        }
      }else{
        if(n[i]==1){
          count1++;
        }
      }
      if(i%2==0){
        if(n[i]==1){
          count2++;
        }
      }else{
        if(n[i]==0){
          count2++;
        }
      }
    }
    

    if(count1<count2){
      System.out.println(count1);
    }else{
      System.out.println(count2);
    }


	}
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
 		Scanner sc = new Scanner(System.in);

    String s=sc.next();
    String ss[]=s.split("");
    int n[]=new int[ss.length];
    for(int i=0;i<ss.length;i++){
      n[i]=Integer.parseInt(ss[i]);
    }

    int count1=0;
    int count2=0;

    for(int i=0;i<n.length;i++){
      if(i%2==0){
        if(n[i]==0){
          count1++;
        }
      }else{
        if(n[i]==1){
          count1++;
        }
      }
      if(i%2==0){
        if(n[i]==1){
          count2++;
        }
      }else{
        if(n[i]==0){
          count2++;
        }
      }
    }
    

    if(count1<count2){
      System.out.println(count1);
    }else{
      System.out.println(count2);
    }


	}
}
