import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int i, count_a = 0, count_b = 0, answer;
    char temp;
    String number = sc.next();
    for(i = 0; i < number.length(); i++) {
      temp = number.charAt(i);
      if(i % 2 == 0) {
        if(temp == '0') count_a++;
        else count_b++;
      } else {
        if(temp == '1') count_a++;
        else count_b++;
      }
    }
    answer = (count_a < count_b)? count_a : count_b;
    System.out.println(answer);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int i, count_a = 0, count_b = 0, answer;
    char temp;
    String number = sc.next();
    for(i = 0; i < number.length(); i++) {
      temp = number.charAt(i);
      if(i % 2 == 0) {
        if(temp == '0') count_a++;
        else count_b++;
      } else {
        if(temp == '1') count_a++;
        else count_b++;
      }
    }
    answer = (count_a < count_b)? count_a : count_b;
    System.out.println(answer);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int i, count_a = 0, count_b = 0, answer;
    char temp;
    String number = sc.next();
    for(i = 0; i < number.length(); i++) {
      temp = number.charAt(i);
      if(i % 2 == 0) {
        if(temp == '0') count_a++;
        else count_b++;
      } else {
        if(temp == '1') count_a++;
        else count_b++;
      }
    }
    answer = (count_a < count_b)? count_a : count_b;
    System.out.println(answer);
  } main {
    Scanner sc = new Scanner(System.in);
    int i, count_a = 0, count_b = 0, answer;
    char temp;
    String number = sc.next();
    for(i = 0; i < number.length(); i++) {
      temp = number.charAt(i);
      if(i % 2 == 0) {
        if(temp == '0') count_a++;
        else count_b++;
      } else {
        if(temp == '1') count_a++;
        else count_b++;
      }
    }
    answer = (count_a < count_b)? count_a : count_b;
    System.out.println(answer);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int i i count_a = 0 count_a 0 count_b = 0 count_b 0 answer; answer char temp; temp String number = sc.next(); number sc.next() sc.next sc for(i = 0; i < number.length(); i++) {
      temp = number.charAt(i);
      if(i % 2 == 0) {
        if(temp == '0') count_a++;
        else count_b++;
      } else {
        if(temp == '1') count_a++;
        else count_b++;
      }
    } i = 0; i = 0 i 0 i < number.length() i number.length() number.length number i++ i++ i {
      temp = number.charAt(i);
      if(i % 2 == 0) {
        if(temp == '0') count_a++;
        else count_b++;
      } else {
        if(temp == '1') count_a++;
        else count_b++;
      }
    } {
      temp = number.charAt(i);
      if(i % 2 == 0) {
        if(temp == '0') count_a++;
        else count_b++;
      } else {
        if(temp == '1') count_a++;
        else count_b++;
      }
    } temp = number.charAt(i) temp number.charAt(i) number.charAt number i if(i % 2 == 0) {
        if(temp == '0') count_a++;
        else count_b++;
      } else {
        if(temp == '1') count_a++;
        else count_b++;
      } i % 2 == 0 i % 2 i 2 0 {
        if(temp == '0') count_a++;
        else count_b++;
      } if(temp == '0') count_a++;
        else count_b++; temp == '0' temp '0' count_a++ count_a count_b++ count_b {
        if(temp == '1') count_a++;
        else count_b++;
      } if(temp == '1') count_a++;
        else count_b++; temp == '1' temp '1' count_a++ count_a count_b++ count_b answer = (count_a < count_b)? count_a : count_b answer (count_a < count_b)? count_a : count_b (count_a < count_b) count_a count_b count_a count_b System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int i, count_a = 0, count_b = 0, answer;
    char temp;
    String number = sc.next();
    for(i = 0; i < number.length(); i++) {
      temp = number.charAt(i);
      if(i % 2 == 0) {
        if(temp == '0') count_a++;
        else count_b++;
      } else {
        if(temp == '1') count_a++;
        else count_b++;
      }
    }
    answer = (count_a < count_b)? count_a : count_b;
    System.out.println(answer);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int i, count_a = 0, count_b = 0, answer;
    char temp;
    String number = sc.next();
    for(i = 0; i < number.length(); i++) {
      temp = number.charAt(i);
      if(i % 2 == 0) {
        if(temp == '0') count_a++;
        else count_b++;
      } else {
        if(temp == '1') count_a++;
        else count_b++;
      }
    }
    answer = (count_a < count_b)? count_a : count_b;
    System.out.println(answer);
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int i, count_a = 0, count_b = 0, answer;
    char temp;
    String number = sc.next();
    for(i = 0; i < number.length(); i++) {
      temp = number.charAt(i);
      if(i % 2 == 0) {
        if(temp == '0') count_a++;
        else count_b++;
      } else {
        if(temp == '1') count_a++;
        else count_b++;
      }
    }
    answer = (count_a < count_b)? count_a : count_b;
    System.out.println(answer);
  }
}
