import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String s = in.readLine();
    
    int evenZeroCnt = 0;
    int oddZeroCnt = 0;
    for(int i=0; i<s.length(); i++) {
      if(i%2!=0 && s.charAt(i)=='1')
        evenZeroCnt++;
      else if(i%2==0 && s.charAt(i)=='0')
        evenZeroCnt++;
      
      if(i%2==0 && s.charAt(i)=='1')
        oddZeroCnt++;
      else if(i%2!=0 && s.charAt(i)=='0')
        oddZeroCnt++;
    }
    
    System.out.println(Math.min(evenZeroCnt,oddZeroCnt));
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String s = in.readLine();
    
    int evenZeroCnt = 0;
    int oddZeroCnt = 0;
    for(int i=0; i<s.length(); i++) {
      if(i%2!=0 && s.charAt(i)=='1')
        evenZeroCnt++;
      else if(i%2==0 && s.charAt(i)=='0')
        evenZeroCnt++;
      
      if(i%2==0 && s.charAt(i)=='1')
        oddZeroCnt++;
      else if(i%2!=0 && s.charAt(i)=='0')
        oddZeroCnt++;
    }
    
    System.out.println(Math.min(evenZeroCnt,oddZeroCnt));
  }
} Main public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String s = in.readLine();
    
    int evenZeroCnt = 0;
    int oddZeroCnt = 0;
    for(int i=0; i<s.length(); i++) {
      if(i%2!=0 && s.charAt(i)=='1')
        evenZeroCnt++;
      else if(i%2==0 && s.charAt(i)=='0')
        evenZeroCnt++;
      
      if(i%2==0 && s.charAt(i)=='1')
        oddZeroCnt++;
      else if(i%2!=0 && s.charAt(i)=='0')
        oddZeroCnt++;
    }
    
    System.out.println(Math.min(evenZeroCnt,oddZeroCnt));
  } main {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String s = in.readLine();
    
    int evenZeroCnt = 0;
    int oddZeroCnt = 0;
    for(int i=0; i<s.length(); i++) {
      if(i%2!=0 && s.charAt(i)=='1')
        evenZeroCnt++;
      else if(i%2==0 && s.charAt(i)=='0')
        evenZeroCnt++;
      
      if(i%2==0 && s.charAt(i)=='1')
        oddZeroCnt++;
      else if(i%2!=0 && s.charAt(i)=='0')
        oddZeroCnt++;
    }
    
    System.out.println(Math.min(evenZeroCnt,oddZeroCnt));
  } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String s = in.readLine(); s in.readLine() in.readLine in int evenZeroCnt = 0; evenZeroCnt 0 int oddZeroCnt = 0; oddZeroCnt 0 for(int i=0; i<s.length(); i++) {
      if(i%2!=0 && s.charAt(i)=='1')
        evenZeroCnt++;
      else if(i%2==0 && s.charAt(i)=='0')
        evenZeroCnt++;
      
      if(i%2==0 && s.charAt(i)=='1')
        oddZeroCnt++;
      else if(i%2!=0 && s.charAt(i)=='0')
        oddZeroCnt++;
    } int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
      if(i%2!=0 && s.charAt(i)=='1')
        evenZeroCnt++;
      else if(i%2==0 && s.charAt(i)=='0')
        evenZeroCnt++;
      
      if(i%2==0 && s.charAt(i)=='1')
        oddZeroCnt++;
      else if(i%2!=0 && s.charAt(i)=='0')
        oddZeroCnt++;
    } {
      if(i%2!=0 && s.charAt(i)=='1')
        evenZeroCnt++;
      else if(i%2==0 && s.charAt(i)=='0')
        evenZeroCnt++;
      
      if(i%2==0 && s.charAt(i)=='1')
        oddZeroCnt++;
      else if(i%2!=0 && s.charAt(i)=='0')
        oddZeroCnt++;
    } if(i%2!=0 && s.charAt(i)=='1')
        evenZeroCnt++;
      else if(i%2==0 && s.charAt(i)=='0')
        evenZeroCnt++; i%2!=0 && s.charAt(i)=='1' i%2!=0 i%2 i 2 0 s.charAt(i)=='1' s.charAt(i) s.charAt s i '1' evenZeroCnt++ evenZeroCnt if(i%2==0 && s.charAt(i)=='0')
        evenZeroCnt++; i%2==0 && s.charAt(i)=='0' i%2==0 i%2 i 2 0 s.charAt(i)=='0' s.charAt(i) s.charAt s i '0' evenZeroCnt++ evenZeroCnt if(i%2==0 && s.charAt(i)=='1')
        oddZeroCnt++;
      else if(i%2!=0 && s.charAt(i)=='0')
        oddZeroCnt++; i%2==0 && s.charAt(i)=='1' i%2==0 i%2 i 2 0 s.charAt(i)=='1' s.charAt(i) s.charAt s i '1' oddZeroCnt++ oddZeroCnt if(i%2!=0 && s.charAt(i)=='0')
        oddZeroCnt++; i%2!=0 && s.charAt(i)=='0' i%2!=0 i%2 i 2 0 s.charAt(i)=='0' s.charAt(i) s.charAt s i '0' oddZeroCnt++ oddZeroCnt System.out.println(Math.min(evenZeroCnt,oddZeroCnt)) System.out.println System.out System System.out Math.min(evenZeroCnt,oddZeroCnt) Math.min Math evenZeroCnt oddZeroCnt String[] args args public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String s = in.readLine();
    
    int evenZeroCnt = 0;
    int oddZeroCnt = 0;
    for(int i=0; i<s.length(); i++) {
      if(i%2!=0 && s.charAt(i)=='1')
        evenZeroCnt++;
      else if(i%2==0 && s.charAt(i)=='0')
        evenZeroCnt++;
      
      if(i%2==0 && s.charAt(i)=='1')
        oddZeroCnt++;
      else if(i%2!=0 && s.charAt(i)=='0')
        oddZeroCnt++;
    }
    
    System.out.println(Math.min(evenZeroCnt,oddZeroCnt));
  }
} public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String s = in.readLine();
    
    int evenZeroCnt = 0;
    int oddZeroCnt = 0;
    for(int i=0; i<s.length(); i++) {
      if(i%2!=0 && s.charAt(i)=='1')
        evenZeroCnt++;
      else if(i%2==0 && s.charAt(i)=='0')
        evenZeroCnt++;
      
      if(i%2==0 && s.charAt(i)=='1')
        oddZeroCnt++;
      else if(i%2!=0 && s.charAt(i)=='0')
        oddZeroCnt++;
    }
    
    System.out.println(Math.min(evenZeroCnt,oddZeroCnt));
  }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String s = in.readLine();
    
    int evenZeroCnt = 0;
    int oddZeroCnt = 0;
    for(int i=0; i<s.length(); i++) {
      if(i%2!=0 && s.charAt(i)=='1')
        evenZeroCnt++;
      else if(i%2==0 && s.charAt(i)=='0')
        evenZeroCnt++;
      
      if(i%2==0 && s.charAt(i)=='1')
        oddZeroCnt++;
      else if(i%2!=0 && s.charAt(i)=='0')
        oddZeroCnt++;
    }
    
    System.out.println(Math.min(evenZeroCnt,oddZeroCnt));
  }
}