import java.util.*;

class Main {
  public static void main(String[] args){
  Scanner sc = new Scanner(System.in);
  String s = sc.next();
  int c1Count = 0;
  int c2Count = 0;
  int c1 = 0;
  int c2 = 1;
  for (int i=0;i<s.length();i++){
    int x1 = Character.getNumericValue(s.charAt(i));
    if (x1 == c1){
      c2Count ++;
    }else
    {
      c1Count ++;
    }
    c1 = (c1 +1) % 2;
    c2 = (c2 +1) % 2;
  }
  System.out.println(Math.min(c1Count,c2Count));
  }
} import java.util.*; util.* java class Main {
  public static void main(String[] args){
  Scanner sc = new Scanner(System.in);
  String s = sc.next();
  int c1Count = 0;
  int c2Count = 0;
  int c1 = 0;
  int c2 = 1;
  for (int i=0;i<s.length();i++){
    int x1 = Character.getNumericValue(s.charAt(i));
    if (x1 == c1){
      c2Count ++;
    }else
    {
      c1Count ++;
    }
    c1 = (c1 +1) % 2;
    c2 = (c2 +1) % 2;
  }
  System.out.println(Math.min(c1Count,c2Count));
  }
} Main public static void main(String[] args){
  Scanner sc = new Scanner(System.in);
  String s = sc.next();
  int c1Count = 0;
  int c2Count = 0;
  int c1 = 0;
  int c2 = 1;
  for (int i=0;i<s.length();i++){
    int x1 = Character.getNumericValue(s.charAt(i));
    if (x1 == c1){
      c2Count ++;
    }else
    {
      c1Count ++;
    }
    c1 = (c1 +1) % 2;
    c2 = (c2 +1) % 2;
  }
  System.out.println(Math.min(c1Count,c2Count));
  } main {
  Scanner sc = new Scanner(System.in);
  String s = sc.next();
  int c1Count = 0;
  int c2Count = 0;
  int c1 = 0;
  int c2 = 1;
  for (int i=0;i<s.length();i++){
    int x1 = Character.getNumericValue(s.charAt(i));
    if (x1 == c1){
      c2Count ++;
    }else
    {
      c1Count ++;
    }
    c1 = (c1 +1) % 2;
    c2 = (c2 +1) % 2;
  }
  System.out.println(Math.min(c1Count,c2Count));
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int c1Count = 0; c1Count 0 int c2Count = 0; c2Count 0 int c1 = 0; c1 0 int c2 = 1; c2 1 for (int i=0;i<s.length();i++){
    int x1 = Character.getNumericValue(s.charAt(i));
    if (x1 == c1){
      c2Count ++;
    }else
    {
      c1Count ++;
    }
    c1 = (c1 +1) % 2;
    c2 = (c2 +1) % 2;
  } int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
    int x1 = Character.getNumericValue(s.charAt(i));
    if (x1 == c1){
      c2Count ++;
    }else
    {
      c1Count ++;
    }
    c1 = (c1 +1) % 2;
    c2 = (c2 +1) % 2;
  } {
    int x1 = Character.getNumericValue(s.charAt(i));
    if (x1 == c1){
      c2Count ++;
    }else
    {
      c1Count ++;
    }
    c1 = (c1 +1) % 2;
    c2 = (c2 +1) % 2;
  } int x1 = Character.getNumericValue(s.charAt(i)); x1 Character.getNumericValue(s.charAt(i)) Character.getNumericValue Character s.charAt(i) s.charAt s i if (x1 == c1){
      c2Count ++;
    }else
    {
      c1Count ++;
    } x1 == c1 x1 c1 {
      c2Count ++;
    } c2Count ++ c2Count {
      c1Count ++;
    } c1Count ++ c1Count c1 = (c1 +1) % 2 c1 (c1 +1) % 2 (c1 +1) c1 1 2 c2 = (c2 +1) % 2 c2 (c2 +1) % 2 (c2 +1) c2 1 2 System.out.println(Math.min(c1Count,c2Count)) System.out.println System.out System System.out Math.min(c1Count,c2Count) Math.min Math c1Count c2Count String[] args args
import java.util.*;

class Main {
  public static void main(String[] args){
  Scanner sc = new Scanner(System.in);
  String s = sc.next();
  int c1Count = 0;
  int c2Count = 0;
  int c1 = 0;
  int c2 = 1;
  for (int i=0;i<s.length();i++){
    int x1 = Character.getNumericValue(s.charAt(i));
    if (x1 == c1){
      c2Count ++;
    }else
    {
      c1Count ++;
    }
    c1 = (c1 +1) % 2;
    c2 = (c2 +1) % 2;
  }
  System.out.println(Math.min(c1Count,c2Count));
  }
}