import java.util.*;

public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    int n1 =0, n2 = 0;
    for(int i = 0; i < S.length(); i++){
      if((i%2 == 0 && S.charAt(i) == '0') || (i%2 == 1 && S.charAt(i) == '1')){
        n1++;
      }else{
        n2++;
      }
    }
    System.out.println(Math.min(n1, n2));
  }
} 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 n1 =0, n2 = 0;
    for(int i = 0; i < S.length(); i++){
      if((i%2 == 0 && S.charAt(i) == '0') || (i%2 == 1 && S.charAt(i) == '1')){
        n1++;
      }else{
        n2++;
      }
    }
    System.out.println(Math.min(n1, n2));
  }
} Main public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    int n1 =0, n2 = 0;
    for(int i = 0; i < S.length(); i++){
      if((i%2 == 0 && S.charAt(i) == '0') || (i%2 == 1 && S.charAt(i) == '1')){
        n1++;
      }else{
        n2++;
      }
    }
    System.out.println(Math.min(n1, n2));
  } main {
    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    int n1 =0, n2 = 0;
    for(int i = 0; i < S.length(); i++){
      if((i%2 == 0 && S.charAt(i) == '0') || (i%2 == 1 && S.charAt(i) == '1')){
        n1++;
      }else{
        n2++;
      }
    }
    System.out.println(Math.min(n1, n2));
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc int n1 =0 n1 0 n2 = 0; n2 0 for(int i = 0; i < S.length(); i++){
      if((i%2 == 0 && S.charAt(i) == '0') || (i%2 == 1 && S.charAt(i) == '1')){
        n1++;
      }else{
        n2++;
      }
    } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
      if((i%2 == 0 && S.charAt(i) == '0') || (i%2 == 1 && S.charAt(i) == '1')){
        n1++;
      }else{
        n2++;
      }
    } {
      if((i%2 == 0 && S.charAt(i) == '0') || (i%2 == 1 && S.charAt(i) == '1')){
        n1++;
      }else{
        n2++;
      }
    } if((i%2 == 0 && S.charAt(i) == '0') || (i%2 == 1 && S.charAt(i) == '1')){
        n1++;
      }else{
        n2++;
      } (i%2 == 0 && S.charAt(i) == '0') || (i%2 == 1 && S.charAt(i) == '1') (i%2 == 0 && S.charAt(i) == '0') i%2 == 0 i%2 i 2 0 S.charAt(i) == '0' S.charAt(i) S.charAt S i '0' (i%2 == 1 && S.charAt(i) == '1') i%2 == 1 i%2 i 2 1 S.charAt(i) == '1' S.charAt(i) S.charAt S i '1' {
        n1++;
      } n1++ n1 {
        n2++;
      } n2++ n2 System.out.println(Math.min(n1, n2)) System.out.println System.out System System.out Math.min(n1, n2) Math.min Math n1 n2 String[]args args public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    int n1 =0, n2 = 0;
    for(int i = 0; i < S.length(); i++){
      if((i%2 == 0 && S.charAt(i) == '0') || (i%2 == 1 && S.charAt(i) == '1')){
        n1++;
      }else{
        n2++;
      }
    }
    System.out.println(Math.min(n1, n2));
  }
} public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    int n1 =0, n2 = 0;
    for(int i = 0; i < S.length(); i++){
      if((i%2 == 0 && S.charAt(i) == '0') || (i%2 == 1 && S.charAt(i) == '1')){
        n1++;
      }else{
        n2++;
      }
    }
    System.out.println(Math.min(n1, n2));
  }
} Main
import java.util.*;

public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    int n1 =0, n2 = 0;
    for(int i = 0; i < S.length(); i++){
      if((i%2 == 0 && S.charAt(i) == '0') || (i%2 == 1 && S.charAt(i) == '1')){
        n1++;
      }else{
        n2++;
      }
    }
    System.out.println(Math.min(n1, n2));
  }
}