import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next(); //Input String
    int N = s.length(); //Size of the input string    
    //Case 1: 101010101010
    int caseoneanswer = 0;
    for(int i = 1; i<=N; i++){
      if(i%2 == 1 && s.charAt(i-1) == '0'){
        caseoneanswer++; 
      } 
      if(i%2 == 0 && s.charAt(i-1) == '1'){
        caseoneanswer++; 
      }
    }
    //Case 2: 01010101010
    int casetwoanswer = 0;
    for(int i = 1; i<=N; i++){
      if(i%2 == 1 && s.charAt(i-1) == '1'){
        casetwoanswer++;
      }
      if(i%2 == 0 && s.charAt(i-1) == '0'){
        casetwoanswer++; 
      }
    }
    System.out.println(Math.min(caseoneanswer, casetwoanswer));
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next(); //Input String
    int N = s.length(); //Size of the input string    
    //Case 1: 101010101010
    int caseoneanswer = 0;
    for(int i = 1; i<=N; i++){
      if(i%2 == 1 && s.charAt(i-1) == '0'){
        caseoneanswer++; 
      } 
      if(i%2 == 0 && s.charAt(i-1) == '1'){
        caseoneanswer++; 
      }
    }
    //Case 2: 01010101010
    int casetwoanswer = 0;
    for(int i = 1; i<=N; i++){
      if(i%2 == 1 && s.charAt(i-1) == '1'){
        casetwoanswer++;
      }
      if(i%2 == 0 && s.charAt(i-1) == '0'){
        casetwoanswer++; 
      }
    }
    System.out.println(Math.min(caseoneanswer, casetwoanswer));
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next(); //Input String
    int N = s.length(); //Size of the input string    
    //Case 1: 101010101010
    int caseoneanswer = 0;
    for(int i = 1; i<=N; i++){
      if(i%2 == 1 && s.charAt(i-1) == '0'){
        caseoneanswer++; 
      } 
      if(i%2 == 0 && s.charAt(i-1) == '1'){
        caseoneanswer++; 
      }
    }
    //Case 2: 01010101010
    int casetwoanswer = 0;
    for(int i = 1; i<=N; i++){
      if(i%2 == 1 && s.charAt(i-1) == '1'){
        casetwoanswer++;
      }
      if(i%2 == 0 && s.charAt(i-1) == '0'){
        casetwoanswer++; 
      }
    }
    System.out.println(Math.min(caseoneanswer, casetwoanswer));
  } main {
    Scanner sc = new Scanner(System.in);
    String s = sc.next(); //Input String
    int N = s.length(); //Size of the input string    
    //Case 1: 101010101010
    int caseoneanswer = 0;
    for(int i = 1; i<=N; i++){
      if(i%2 == 1 && s.charAt(i-1) == '0'){
        caseoneanswer++; 
      } 
      if(i%2 == 0 && s.charAt(i-1) == '1'){
        caseoneanswer++; 
      }
    }
    //Case 2: 01010101010
    int casetwoanswer = 0;
    for(int i = 1; i<=N; i++){
      if(i%2 == 1 && s.charAt(i-1) == '1'){
        casetwoanswer++;
      }
      if(i%2 == 0 && s.charAt(i-1) == '0'){
        casetwoanswer++; 
      }
    }
    System.out.println(Math.min(caseoneanswer, casetwoanswer));
  } 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 int caseoneanswer = 0; caseoneanswer 0 for(int i = 1; i<=N; i++){
      if(i%2 == 1 && s.charAt(i-1) == '0'){
        caseoneanswer++; 
      } 
      if(i%2 == 0 && s.charAt(i-1) == '1'){
        caseoneanswer++; 
      }
    } int i = 1; int i = 1; i 1 i<=N i N i++ i++ i {
      if(i%2 == 1 && s.charAt(i-1) == '0'){
        caseoneanswer++; 
      } 
      if(i%2 == 0 && s.charAt(i-1) == '1'){
        caseoneanswer++; 
      }
    } {
      if(i%2 == 1 && s.charAt(i-1) == '0'){
        caseoneanswer++; 
      } 
      if(i%2 == 0 && s.charAt(i-1) == '1'){
        caseoneanswer++; 
      }
    } if(i%2 == 1 && s.charAt(i-1) == '0'){
        caseoneanswer++; 
      } i%2 == 1 && s.charAt(i-1) == '0' i%2 == 1 i%2 i 2 1 s.charAt(i-1) == '0' s.charAt(i-1) s.charAt s i-1 i 1 '0' {
        caseoneanswer++; 
      } caseoneanswer++ caseoneanswer if(i%2 == 0 && s.charAt(i-1) == '1'){
        caseoneanswer++; 
      } i%2 == 0 && s.charAt(i-1) == '1' i%2 == 0 i%2 i 2 0 s.charAt(i-1) == '1' s.charAt(i-1) s.charAt s i-1 i 1 '1' {
        caseoneanswer++; 
      } caseoneanswer++ caseoneanswer int casetwoanswer = 0; casetwoanswer 0 for(int i = 1; i<=N; i++){
      if(i%2 == 1 && s.charAt(i-1) == '1'){
        casetwoanswer++;
      }
      if(i%2 == 0 && s.charAt(i-1) == '0'){
        casetwoanswer++; 
      }
    } int i = 1; int i = 1; i 1 i<=N i N i++ i++ i {
      if(i%2 == 1 && s.charAt(i-1) == '1'){
        casetwoanswer++;
      }
      if(i%2 == 0 && s.charAt(i-1) == '0'){
        casetwoanswer++; 
      }
    } {
      if(i%2 == 1 && s.charAt(i-1) == '1'){
        casetwoanswer++;
      }
      if(i%2 == 0 && s.charAt(i-1) == '0'){
        casetwoanswer++; 
      }
    } if(i%2 == 1 && s.charAt(i-1) == '1'){
        casetwoanswer++;
      } i%2 == 1 && s.charAt(i-1) == '1' i%2 == 1 i%2 i 2 1 s.charAt(i-1) == '1' s.charAt(i-1) s.charAt s i-1 i 1 '1' {
        casetwoanswer++;
      } casetwoanswer++ casetwoanswer if(i%2 == 0 && s.charAt(i-1) == '0'){
        casetwoanswer++; 
      } i%2 == 0 && s.charAt(i-1) == '0' i%2 == 0 i%2 i 2 0 s.charAt(i-1) == '0' s.charAt(i-1) s.charAt s i-1 i 1 '0' {
        casetwoanswer++; 
      } casetwoanswer++ casetwoanswer System.out.println(Math.min(caseoneanswer, casetwoanswer)) System.out.println System.out System System.out Math.min(caseoneanswer, casetwoanswer) Math.min Math caseoneanswer casetwoanswer String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next(); //Input String
    int N = s.length(); //Size of the input string    
    //Case 1: 101010101010
    int caseoneanswer = 0;
    for(int i = 1; i<=N; i++){
      if(i%2 == 1 && s.charAt(i-1) == '0'){
        caseoneanswer++; 
      } 
      if(i%2 == 0 && s.charAt(i-1) == '1'){
        caseoneanswer++; 
      }
    }
    //Case 2: 01010101010
    int casetwoanswer = 0;
    for(int i = 1; i<=N; i++){
      if(i%2 == 1 && s.charAt(i-1) == '1'){
        casetwoanswer++;
      }
      if(i%2 == 0 && s.charAt(i-1) == '0'){
        casetwoanswer++; 
      }
    }
    System.out.println(Math.min(caseoneanswer, casetwoanswer));
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next(); //Input String
    int N = s.length(); //Size of the input string    
    //Case 1: 101010101010
    int caseoneanswer = 0;
    for(int i = 1; i<=N; i++){
      if(i%2 == 1 && s.charAt(i-1) == '0'){
        caseoneanswer++; 
      } 
      if(i%2 == 0 && s.charAt(i-1) == '1'){
        caseoneanswer++; 
      }
    }
    //Case 2: 01010101010
    int casetwoanswer = 0;
    for(int i = 1; i<=N; i++){
      if(i%2 == 1 && s.charAt(i-1) == '1'){
        casetwoanswer++;
      }
      if(i%2 == 0 && s.charAt(i-1) == '0'){
        casetwoanswer++; 
      }
    }
    System.out.println(Math.min(caseoneanswer, casetwoanswer));
  }
} Main
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next(); //Input String
    int N = s.length(); //Size of the input string    
    //Case 1: 101010101010
    int caseoneanswer = 0;
    for(int i = 1; i<=N; i++){
      if(i%2 == 1 && s.charAt(i-1) == '0'){
        caseoneanswer++; 
      } 
      if(i%2 == 0 && s.charAt(i-1) == '1'){
        caseoneanswer++; 
      }
    }
    //Case 2: 01010101010
    int casetwoanswer = 0;
    for(int i = 1; i<=N; i++){
      if(i%2 == 1 && s.charAt(i-1) == '1'){
        casetwoanswer++;
      }
      if(i%2 == 0 && s.charAt(i-1) == '0'){
        casetwoanswer++; 
      }
    }
    System.out.println(Math.min(caseoneanswer, casetwoanswer));
  }
}