import java.util.*;
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S[] = sc.next().split("");
    String a = "1";
    String b = "0";
    int countA = 0;
    int countB = 0;
    for (String s : S) {
      if (s.equals(a)) {
        countA++;	
      }
      if (s.equals(b)) {
        countB++;
      }
      String t = a;
      a = b;
      b = t;
    }
    System.out.println(Math.min(countA,countB));
  }
} import java.util.*; util.* java class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S[] = sc.next().split("");
    String a = "1";
    String b = "0";
    int countA = 0;
    int countB = 0;
    for (String s : S) {
      if (s.equals(a)) {
        countA++;	
      }
      if (s.equals(b)) {
        countB++;
      }
      String t = a;
      a = b;
      b = t;
    }
    System.out.println(Math.min(countA,countB));
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S[] = sc.next().split("");
    String a = "1";
    String b = "0";
    int countA = 0;
    int countB = 0;
    for (String s : S) {
      if (s.equals(a)) {
        countA++;	
      }
      if (s.equals(b)) {
        countB++;
      }
      String t = a;
      a = b;
      b = t;
    }
    System.out.println(Math.min(countA,countB));
  } main {
    Scanner sc = new Scanner(System.in);
    String S[] = sc.next().split("");
    String a = "1";
    String b = "0";
    int countA = 0;
    int countB = 0;
    for (String s : S) {
      if (s.equals(a)) {
        countA++;	
      }
      if (s.equals(b)) {
        countB++;
      }
      String t = a;
      a = b;
      b = t;
    }
    System.out.println(Math.min(countA,countB));
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S[] = sc.next().split(""); S sc.next().split("") sc.next().split sc.next() sc.next sc "" String a = "1"; a "1" String b = "0"; b "0" int countA = 0; countA 0 int countB = 0; countB 0 for (String s : S) {
      if (s.equals(a)) {
        countA++;	
      }
      if (s.equals(b)) {
        countB++;
      }
      String t = a;
      a = b;
      b = t;
    } String s S {
      if (s.equals(a)) {
        countA++;	
      }
      if (s.equals(b)) {
        countB++;
      }
      String t = a;
      a = b;
      b = t;
    } {
      if (s.equals(a)) {
        countA++;	
      }
      if (s.equals(b)) {
        countB++;
      }
      String t = a;
      a = b;
      b = t;
    } if (s.equals(a)) {
        countA++;	
      } s.equals(a) s.equals s a {
        countA++;	
      } countA++ countA if (s.equals(b)) {
        countB++;
      } s.equals(b) s.equals s b {
        countB++;
      } countB++ countB String t = a; t a a = b a b b = t b t System.out.println(Math.min(countA,countB)) System.out.println System.out System System.out Math.min(countA,countB) Math.min Math countA countB String[] args args
import java.util.*;
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S[] = sc.next().split("");
    String a = "1";
    String b = "0";
    int countA = 0;
    int countB = 0;
    for (String s : S) {
      if (s.equals(a)) {
        countA++;	
      }
      if (s.equals(b)) {
        countB++;
      }
      String t = a;
      a = b;
      b = t;
    }
    System.out.println(Math.min(countA,countB));
  }
}