import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    sc.close();

    String[] S = s.split("");

    // 0101...にした場合
    int count1 = 0;

    // 1010...にした場合
    int count2 = 0;

    for (int i = 0; i < S.length; i++) {
      if (i % 2 == 0) {
        if (S[i].equals("1")) {
          count1++;
        } else {
          count2++;
        }
      } else { 
        if (S[i].equals("0")) {
          count1++;
        } else {
          count2++;
        }
      }
    }

    System.out.println(Math.min(count1, count2));

  }

} import java.util.*; util.* java public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    sc.close();

    String[] S = s.split("");

    // 0101...にした場合
    int count1 = 0;

    // 1010...にした場合
    int count2 = 0;

    for (int i = 0; i < S.length; i++) {
      if (i % 2 == 0) {
        if (S[i].equals("1")) {
          count1++;
        } else {
          count2++;
        }
      } else { 
        if (S[i].equals("0")) {
          count1++;
        } else {
          count2++;
        }
      }
    }

    System.out.println(Math.min(count1, count2));

  }

} Main public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    sc.close();

    String[] S = s.split("");

    // 0101...にした場合
    int count1 = 0;

    // 1010...にした場合
    int count2 = 0;

    for (int i = 0; i < S.length; i++) {
      if (i % 2 == 0) {
        if (S[i].equals("1")) {
          count1++;
        } else {
          count2++;
        }
      } else { 
        if (S[i].equals("0")) {
          count1++;
        } else {
          count2++;
        }
      }
    }

    System.out.println(Math.min(count1, count2));

  } main {

    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    sc.close();

    String[] S = s.split("");

    // 0101...にした場合
    int count1 = 0;

    // 1010...にした場合
    int count2 = 0;

    for (int i = 0; i < S.length; i++) {
      if (i % 2 == 0) {
        if (S[i].equals("1")) {
          count1++;
        } else {
          count2++;
        }
      } else { 
        if (S[i].equals("0")) {
          count1++;
        } else {
          count2++;
        }
      }
    }

    System.out.println(Math.min(count1, count2));

  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc sc.close() sc.close sc String[] S = s.split(""); S s.split("") s.split s "" int count1 = 0; count1 0 int count2 = 0; count2 0 for (int i = 0; i < S.length; i++) {
      if (i % 2 == 0) {
        if (S[i].equals("1")) {
          count1++;
        } else {
          count2++;
        }
      } else { 
        if (S[i].equals("0")) {
          count1++;
        } else {
          count2++;
        }
      }
    } int i = 0; int i = 0; i 0 i < S.length i S.length S S.length i++ i++ i {
      if (i % 2 == 0) {
        if (S[i].equals("1")) {
          count1++;
        } else {
          count2++;
        }
      } else { 
        if (S[i].equals("0")) {
          count1++;
        } else {
          count2++;
        }
      }
    } {
      if (i % 2 == 0) {
        if (S[i].equals("1")) {
          count1++;
        } else {
          count2++;
        }
      } else { 
        if (S[i].equals("0")) {
          count1++;
        } else {
          count2++;
        }
      }
    } if (i % 2 == 0) {
        if (S[i].equals("1")) {
          count1++;
        } else {
          count2++;
        }
      } else { 
        if (S[i].equals("0")) {
          count1++;
        } else {
          count2++;
        }
      } i % 2 == 0 i % 2 i 2 0 {
        if (S[i].equals("1")) {
          count1++;
        } else {
          count2++;
        }
      } if (S[i].equals("1")) {
          count1++;
        } else {
          count2++;
        } S[i].equals("1") S[i].equals S[i] S i "1" {
          count1++;
        } count1++ count1 {
          count2++;
        } count2++ count2 { 
        if (S[i].equals("0")) {
          count1++;
        } else {
          count2++;
        }
      } if (S[i].equals("0")) {
          count1++;
        } else {
          count2++;
        } S[i].equals("0") S[i].equals S[i] S i "0" {
          count1++;
        } count1++ count1 {
          count2++;
        } count2++ count2 System.out.println(Math.min(count1, count2)) System.out.println System.out System System.out Math.min(count1, count2) Math.min Math count1 count2 String[] args args public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    sc.close();

    String[] S = s.split("");

    // 0101...にした場合
    int count1 = 0;

    // 1010...にした場合
    int count2 = 0;

    for (int i = 0; i < S.length; i++) {
      if (i % 2 == 0) {
        if (S[i].equals("1")) {
          count1++;
        } else {
          count2++;
        }
      } else { 
        if (S[i].equals("0")) {
          count1++;
        } else {
          count2++;
        }
      }
    }

    System.out.println(Math.min(count1, count2));

  }

} public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    sc.close();

    String[] S = s.split("");

    // 0101...にした場合
    int count1 = 0;

    // 1010...にした場合
    int count2 = 0;

    for (int i = 0; i < S.length; i++) {
      if (i % 2 == 0) {
        if (S[i].equals("1")) {
          count1++;
        } else {
          count2++;
        }
      } else { 
        if (S[i].equals("0")) {
          count1++;
        } else {
          count2++;
        }
      }
    }

    System.out.println(Math.min(count1, count2));

  }

} Main
import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    sc.close();

    String[] S = s.split("");

    // 0101...にした場合
    int count1 = 0;

    // 1010...にした場合
    int count2 = 0;

    for (int i = 0; i < S.length; i++) {
      if (i % 2 == 0) {
        if (S[i].equals("1")) {
          count1++;
        } else {
          count2++;
        }
      } else { 
        if (S[i].equals("0")) {
          count1++;
        } else {
          count2++;
        }
      }
    }

    System.out.println(Math.min(count1, count2));

  }

}