import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        sc.close();
        char[]c = s.toCharArray();
        int count0 = 0;
        int count1 = 0;
        
        if(c[0] == '0'){
            for(int i = 1; i < c.length; i++) {
              if(i % 2 == 1){
                if( c[i] == '0'){
                    count0++;
                }
              }else{
                if( c[i] == '1'){
                    count0++;
                } 
              }
            }   
        }
        if(c[0] == '1'){
            for(int i = 1; i < c.length; i++) {
              if(i % 2 == 1){
                if( c[i] == '1'){
                    count1++;
                }
              }else{
                if( c[i] == '0'){
                    count1++;
                } 
              }
            }
            
        }
        System.out.println(Math.max(count0, count1));
    }
}  
   import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        sc.close();
        char[]c = s.toCharArray();
        int count0 = 0;
        int count1 = 0;
        
        if(c[0] == '0'){
            for(int i = 1; i < c.length; i++) {
              if(i % 2 == 1){
                if( c[i] == '0'){
                    count0++;
                }
              }else{
                if( c[i] == '1'){
                    count0++;
                } 
              }
            }   
        }
        if(c[0] == '1'){
            for(int i = 1; i < c.length; i++) {
              if(i % 2 == 1){
                if( c[i] == '1'){
                    count1++;
                }
              }else{
                if( c[i] == '0'){
                    count1++;
                } 
              }
            }
            
        }
        System.out.println(Math.max(count0, count1));
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        sc.close();
        char[]c = s.toCharArray();
        int count0 = 0;
        int count1 = 0;
        
        if(c[0] == '0'){
            for(int i = 1; i < c.length; i++) {
              if(i % 2 == 1){
                if( c[i] == '0'){
                    count0++;
                }
              }else{
                if( c[i] == '1'){
                    count0++;
                } 
              }
            }   
        }
        if(c[0] == '1'){
            for(int i = 1; i < c.length; i++) {
              if(i % 2 == 1){
                if( c[i] == '1'){
                    count1++;
                }
              }else{
                if( c[i] == '0'){
                    count1++;
                } 
              }
            }
            
        }
        System.out.println(Math.max(count0, count1));
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        sc.close();
        char[]c = s.toCharArray();
        int count0 = 0;
        int count1 = 0;
        
        if(c[0] == '0'){
            for(int i = 1; i < c.length; i++) {
              if(i % 2 == 1){
                if( c[i] == '0'){
                    count0++;
                }
              }else{
                if( c[i] == '1'){
                    count0++;
                } 
              }
            }   
        }
        if(c[0] == '1'){
            for(int i = 1; i < c.length; i++) {
              if(i % 2 == 1){
                if( c[i] == '1'){
                    count1++;
                }
              }else{
                if( c[i] == '0'){
                    count1++;
                } 
              }
            }
            
        }
        System.out.println(Math.max(count0, count1));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc sc.close() sc.close sc char[]c = s.toCharArray(); c s.toCharArray() s.toCharArray s int count0 = 0; count0 0 int count1 = 0; count1 0 if(c[0] == '0'){
            for(int i = 1; i < c.length; i++) {
              if(i % 2 == 1){
                if( c[i] == '0'){
                    count0++;
                }
              }else{
                if( c[i] == '1'){
                    count0++;
                } 
              }
            }   
        } c[0] == '0' c[0] c 0 '0' {
            for(int i = 1; i < c.length; i++) {
              if(i % 2 == 1){
                if( c[i] == '0'){
                    count0++;
                }
              }else{
                if( c[i] == '1'){
                    count0++;
                } 
              }
            }   
        } for(int i = 1; i < c.length; i++) {
              if(i % 2 == 1){
                if( c[i] == '0'){
                    count0++;
                }
              }else{
                if( c[i] == '1'){
                    count0++;
                } 
              }
            } int i = 1; int i = 1; i 1 i < c.length i c.length c c.length i++ i++ i {
              if(i % 2 == 1){
                if( c[i] == '0'){
                    count0++;
                }
              }else{
                if( c[i] == '1'){
                    count0++;
                } 
              }
            } {
              if(i % 2 == 1){
                if( c[i] == '0'){
                    count0++;
                }
              }else{
                if( c[i] == '1'){
                    count0++;
                } 
              }
            } if(i % 2 == 1){
                if( c[i] == '0'){
                    count0++;
                }
              }else{
                if( c[i] == '1'){
                    count0++;
                } 
              } i % 2 == 1 i % 2 i 2 1 {
                if( c[i] == '0'){
                    count0++;
                }
              } if( c[i] == '0'){
                    count0++;
                } c[i] == '0' c[i] c i '0' {
                    count0++;
                } count0++ count0 {
                if( c[i] == '1'){
                    count0++;
                } 
              } if( c[i] == '1'){
                    count0++;
                } c[i] == '1' c[i] c i '1' {
                    count0++;
                } count0++ count0 if(c[0] == '1'){
            for(int i = 1; i < c.length; i++) {
              if(i % 2 == 1){
                if( c[i] == '1'){
                    count1++;
                }
              }else{
                if( c[i] == '0'){
                    count1++;
                } 
              }
            }
            
        } c[0] == '1' c[0] c 0 '1' {
            for(int i = 1; i < c.length; i++) {
              if(i % 2 == 1){
                if( c[i] == '1'){
                    count1++;
                }
              }else{
                if( c[i] == '0'){
                    count1++;
                } 
              }
            }
            
        } for(int i = 1; i < c.length; i++) {
              if(i % 2 == 1){
                if( c[i] == '1'){
                    count1++;
                }
              }else{
                if( c[i] == '0'){
                    count1++;
                } 
              }
            } int i = 1; int i = 1; i 1 i < c.length i c.length c c.length i++ i++ i {
              if(i % 2 == 1){
                if( c[i] == '1'){
                    count1++;
                }
              }else{
                if( c[i] == '0'){
                    count1++;
                } 
              }
            } {
              if(i % 2 == 1){
                if( c[i] == '1'){
                    count1++;
                }
              }else{
                if( c[i] == '0'){
                    count1++;
                } 
              }
            } if(i % 2 == 1){
                if( c[i] == '1'){
                    count1++;
                }
              }else{
                if( c[i] == '0'){
                    count1++;
                } 
              } i % 2 == 1 i % 2 i 2 1 {
                if( c[i] == '1'){
                    count1++;
                }
              } if( c[i] == '1'){
                    count1++;
                } c[i] == '1' c[i] c i '1' {
                    count1++;
                } count1++ count1 {
                if( c[i] == '0'){
                    count1++;
                } 
              } if( c[i] == '0'){
                    count1++;
                } c[i] == '0' c[i] c i '0' {
                    count1++;
                } count1++ count1 System.out.println(Math.max(count0, count1)) System.out.println System.out System System.out Math.max(count0, count1) Math.max Math count0 count1 String[] args args
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        sc.close();
        char[]c = s.toCharArray();
        int count0 = 0;
        int count1 = 0;
        
        if(c[0] == '0'){
            for(int i = 1; i < c.length; i++) {
              if(i % 2 == 1){
                if( c[i] == '0'){
                    count0++;
                }
              }else{
                if( c[i] == '1'){
                    count0++;
                } 
              }
            }   
        }
        if(c[0] == '1'){
            for(int i = 1; i < c.length; i++) {
              if(i % 2 == 1){
                if( c[i] == '1'){
                    count1++;
                }
              }else{
                if( c[i] == '0'){
                    count1++;
                } 
              }
            }
            
        }
        System.out.println(Math.max(count0, count1));
    }
}  
  