import java.util.*;

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

    String TAILES = sc.next();
    int sum = 0;

    char anxis = TAILES.charAt(0);
    char next;
    if(anxis == '0'){
      next = '1';
    }else{
      next = '0';
    }

    for(int i=1;i<TAILES.length();i++){
      if(TAILES.charAt(i) != next){
        sum+=1;
      }
      if(next == '0'){
        next = '1';
      }else{
        next ='0';
      }
    }
    System.out.println(sum);
  }
} import java.util.*; util.* java class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    String TAILES = sc.next();
    int sum = 0;

    char anxis = TAILES.charAt(0);
    char next;
    if(anxis == '0'){
      next = '1';
    }else{
      next = '0';
    }

    for(int i=1;i<TAILES.length();i++){
      if(TAILES.charAt(i) != next){
        sum+=1;
      }
      if(next == '0'){
        next = '1';
      }else{
        next ='0';
      }
    }
    System.out.println(sum);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    String TAILES = sc.next();
    int sum = 0;

    char anxis = TAILES.charAt(0);
    char next;
    if(anxis == '0'){
      next = '1';
    }else{
      next = '0';
    }

    for(int i=1;i<TAILES.length();i++){
      if(TAILES.charAt(i) != next){
        sum+=1;
      }
      if(next == '0'){
        next = '1';
      }else{
        next ='0';
      }
    }
    System.out.println(sum);
  } main {
    Scanner sc = new Scanner(System.in);

    String TAILES = sc.next();
    int sum = 0;

    char anxis = TAILES.charAt(0);
    char next;
    if(anxis == '0'){
      next = '1';
    }else{
      next = '0';
    }

    for(int i=1;i<TAILES.length();i++){
      if(TAILES.charAt(i) != next){
        sum+=1;
      }
      if(next == '0'){
        next = '1';
      }else{
        next ='0';
      }
    }
    System.out.println(sum);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String TAILES = sc.next(); TAILES sc.next() sc.next sc int sum = 0; sum 0 char anxis = TAILES.charAt(0); anxis TAILES.charAt(0) TAILES.charAt TAILES 0 char next; next if(anxis == '0'){
      next = '1';
    }else{
      next = '0';
    } anxis == '0' anxis '0' {
      next = '1';
    } next = '1' next '1' {
      next = '0';
    } next = '0' next '0' for(int i=1;i<TAILES.length();i++){
      if(TAILES.charAt(i) != next){
        sum+=1;
      }
      if(next == '0'){
        next = '1';
      }else{
        next ='0';
      }
    } int i=1; int i=1; i 1 i<TAILES.length() i TAILES.length() TAILES.length TAILES i++ i++ i {
      if(TAILES.charAt(i) != next){
        sum+=1;
      }
      if(next == '0'){
        next = '1';
      }else{
        next ='0';
      }
    } {
      if(TAILES.charAt(i) != next){
        sum+=1;
      }
      if(next == '0'){
        next = '1';
      }else{
        next ='0';
      }
    } if(TAILES.charAt(i) != next){
        sum+=1;
      } TAILES.charAt(i) != next TAILES.charAt(i) TAILES.charAt TAILES i next {
        sum+=1;
      } sum+=1 sum 1 if(next == '0'){
        next = '1';
      }else{
        next ='0';
      } next == '0' next '0' {
        next = '1';
      } next = '1' next '1' {
        next ='0';
      } next ='0' next '0' System.out.println(sum) System.out.println System.out System System.out sum String[] args args
import java.util.*;

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

    String TAILES = sc.next();
    int sum = 0;

    char anxis = TAILES.charAt(0);
    char next;
    if(anxis == '0'){
      next = '1';
    }else{
      next = '0';
    }

    for(int i=1;i<TAILES.length();i++){
      if(TAILES.charAt(i) != next){
        sum+=1;
      }
      if(next == '0'){
        next = '1';
      }else{
        next ='0';
      }
    }
    System.out.println(sum);
  }
}