import java.util.*;

class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    String s[] = str.split("");
    int count = 0;

    for (int i = 0; i < str.length(); i++) {
      if (s[i].equals(Integer.toString(i%2)) == false)
        count++;
    }
    System.out.println(str.length()-count<count ? str.length()-count : count);
  }
} import java.util.*; util.* java class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    String s[] = str.split("");
    int count = 0;

    for (int i = 0; i < str.length(); i++) {
      if (s[i].equals(Integer.toString(i%2)) == false)
        count++;
    }
    System.out.println(str.length()-count<count ? str.length()-count : count);
  }
} Main public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    String s[] = str.split("");
    int count = 0;

    for (int i = 0; i < str.length(); i++) {
      if (s[i].equals(Integer.toString(i%2)) == false)
        count++;
    }
    System.out.println(str.length()-count<count ? str.length()-count : count);
  } main {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    String s[] = str.split("");
    int count = 0;

    for (int i = 0; i < str.length(); i++) {
      if (s[i].equals(Integer.toString(i%2)) == false)
        count++;
    }
    System.out.println(str.length()-count<count ? str.length()-count : count);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.next(); str sc.next() sc.next sc String s[] = str.split(""); s str.split("") str.split str "" int count = 0; count 0 for (int i = 0; i < str.length(); i++) {
      if (s[i].equals(Integer.toString(i%2)) == false)
        count++;
    } int i = 0; int i = 0; i 0 i < str.length() i str.length() str.length str i++ i++ i {
      if (s[i].equals(Integer.toString(i%2)) == false)
        count++;
    } {
      if (s[i].equals(Integer.toString(i%2)) == false)
        count++;
    } if (s[i].equals(Integer.toString(i%2)) == false)
        count++; s[i].equals(Integer.toString(i%2)) == false s[i].equals(Integer.toString(i%2)) s[i].equals s[i] s i Integer.toString(i%2) Integer.toString Integer i%2 i 2 false count++ count System.out.println(str.length()-count<count ? str.length()-count : count) System.out.println System.out System System.out str.length()-count<count ? str.length()-count : count str.length()-count<count str.length()-count str.length() str.length str count count str.length()-count str.length() str.length str count count String args[] args
import java.util.*;

class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    String s[] = str.split("");
    int count = 0;

    for (int i = 0; i < str.length(); i++) {
      if (s[i].equals(Integer.toString(i%2)) == false)
        count++;
    }
    System.out.println(str.length()-count<count ? str.length()-count : count);
  }
}
