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