import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int ans;
    char[] nums = sc.nextLine().toCharArray();
    int numLength = nums.length;
    int bw = 0;
    int wb = 0;
    for(int cnt = 0; cnt < numLength ; cnt++){
      if( nums[cnt] == ((cnt % 2 == 0)? '0': '1' )){
        bw++;
      }
      else {
        wb++; 
      }
    }
    ans = Math.min(bw,wb);
    System.out.println(ans);
    sc.close();
  }
} import java.util.Scanner; Scanner java.util public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int ans;
    char[] nums = sc.nextLine().toCharArray();
    int numLength = nums.length;
    int bw = 0;
    int wb = 0;
    for(int cnt = 0; cnt < numLength ; cnt++){
      if( nums[cnt] == ((cnt % 2 == 0)? '0': '1' )){
        bw++;
      }
      else {
        wb++; 
      }
    }
    ans = Math.min(bw,wb);
    System.out.println(ans);
    sc.close();
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int ans;
    char[] nums = sc.nextLine().toCharArray();
    int numLength = nums.length;
    int bw = 0;
    int wb = 0;
    for(int cnt = 0; cnt < numLength ; cnt++){
      if( nums[cnt] == ((cnt % 2 == 0)? '0': '1' )){
        bw++;
      }
      else {
        wb++; 
      }
    }
    ans = Math.min(bw,wb);
    System.out.println(ans);
    sc.close();
  } main {
    Scanner sc = new Scanner(System.in);
    int ans;
    char[] nums = sc.nextLine().toCharArray();
    int numLength = nums.length;
    int bw = 0;
    int wb = 0;
    for(int cnt = 0; cnt < numLength ; cnt++){
      if( nums[cnt] == ((cnt % 2 == 0)? '0': '1' )){
        bw++;
      }
      else {
        wb++; 
      }
    }
    ans = Math.min(bw,wb);
    System.out.println(ans);
    sc.close();
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int ans; ans char[] nums = sc.nextLine().toCharArray(); nums sc.nextLine().toCharArray() sc.nextLine().toCharArray sc.nextLine() sc.nextLine sc int numLength = nums.length; numLength nums.length nums nums.length int bw = 0; bw 0 int wb = 0; wb 0 for(int cnt = 0; cnt < numLength ; cnt++){
      if( nums[cnt] == ((cnt % 2 == 0)? '0': '1' )){
        bw++;
      }
      else {
        wb++; 
      }
    } int cnt = 0; int cnt = 0; cnt 0 cnt < numLength cnt numLength cnt++ cnt++ cnt {
      if( nums[cnt] == ((cnt % 2 == 0)? '0': '1' )){
        bw++;
      }
      else {
        wb++; 
      }
    } {
      if( nums[cnt] == ((cnt % 2 == 0)? '0': '1' )){
        bw++;
      }
      else {
        wb++; 
      }
    } if( nums[cnt] == ((cnt % 2 == 0)? '0': '1' )){
        bw++;
      }
      else {
        wb++; 
      } nums[cnt] == ((cnt % 2 == 0)? '0': '1' ) nums[cnt] nums cnt ((cnt % 2 == 0)? '0': '1' ) (cnt % 2 == 0) cnt % 2 cnt 2 0 '0' '1' {
        bw++;
      } bw++ bw {
        wb++; 
      } wb++ wb ans = Math.min(bw,wb) ans Math.min(bw,wb) Math.min Math bw wb System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int ans;
    char[] nums = sc.nextLine().toCharArray();
    int numLength = nums.length;
    int bw = 0;
    int wb = 0;
    for(int cnt = 0; cnt < numLength ; cnt++){
      if( nums[cnt] == ((cnt % 2 == 0)? '0': '1' )){
        bw++;
      }
      else {
        wb++; 
      }
    }
    ans = Math.min(bw,wb);
    System.out.println(ans);
    sc.close();
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int ans;
    char[] nums = sc.nextLine().toCharArray();
    int numLength = nums.length;
    int bw = 0;
    int wb = 0;
    for(int cnt = 0; cnt < numLength ; cnt++){
      if( nums[cnt] == ((cnt % 2 == 0)? '0': '1' )){
        bw++;
      }
      else {
        wb++; 
      }
    }
    ans = Math.min(bw,wb);
    System.out.println(ans);
    sc.close();
  }
} Main
import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int ans;
    char[] nums = sc.nextLine().toCharArray();
    int numLength = nums.length;
    int bw = 0;
    int wb = 0;
    for(int cnt = 0; cnt < numLength ; cnt++){
      if( nums[cnt] == ((cnt % 2 == 0)? '0': '1' )){
        bw++;
      }
      else {
        wb++; 
      }
    }
    ans = Math.min(bw,wb);
    System.out.println(ans);
    sc.close();
  }
}