import java.util.Scanner;

public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);

    String pat = "";
    for (int i = 0; i < 50001; i++) {
      pat += "01";
    }

    String s = sc.next();
    int n01 = 0;
    int n10 = 0;

    for (int i = 0; i < s.length(); i++) {
      if (pat.charAt(i) != s.charAt(i)) {
        n01++;
      }
    }

    for (int i = 0; i < s.length(); i++) {
      if (pat.charAt(i + 1) != s.charAt(i)) {
        n10++;
      }
    }

    System.out.println(Math.min(n01, n10));

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

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);

    String pat = "";
    for (int i = 0; i < 50001; i++) {
      pat += "01";
    }

    String s = sc.next();
    int n01 = 0;
    int n10 = 0;

    for (int i = 0; i < s.length(); i++) {
      if (pat.charAt(i) != s.charAt(i)) {
        n01++;
      }
    }

    for (int i = 0; i < s.length(); i++) {
      if (pat.charAt(i + 1) != s.charAt(i)) {
        n10++;
      }
    }

    System.out.println(Math.min(n01, n10));

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

    Scanner sc = new Scanner(System.in);

    String pat = "";
    for (int i = 0; i < 50001; i++) {
      pat += "01";
    }

    String s = sc.next();
    int n01 = 0;
    int n10 = 0;

    for (int i = 0; i < s.length(); i++) {
      if (pat.charAt(i) != s.charAt(i)) {
        n01++;
      }
    }

    for (int i = 0; i < s.length(); i++) {
      if (pat.charAt(i + 1) != s.charAt(i)) {
        n10++;
      }
    }

    System.out.println(Math.min(n01, n10));

  } main {

    Scanner sc = new Scanner(System.in);

    String pat = "";
    for (int i = 0; i < 50001; i++) {
      pat += "01";
    }

    String s = sc.next();
    int n01 = 0;
    int n10 = 0;

    for (int i = 0; i < s.length(); i++) {
      if (pat.charAt(i) != s.charAt(i)) {
        n01++;
      }
    }

    for (int i = 0; i < s.length(); i++) {
      if (pat.charAt(i + 1) != s.charAt(i)) {
        n10++;
      }
    }

    System.out.println(Math.min(n01, n10));

  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String pat = ""; pat "" for (int i = 0; i < 50001; i++) {
      pat += "01";
    } int i = 0; int i = 0; i 0 i < 50001 i 50001 i++ i++ i {
      pat += "01";
    } {
      pat += "01";
    } pat += "01" pat "01" String s = sc.next(); s sc.next() sc.next sc int n01 = 0; n01 0 int n10 = 0; n10 0 for (int i = 0; i < s.length(); i++) {
      if (pat.charAt(i) != s.charAt(i)) {
        n01++;
      }
    } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
      if (pat.charAt(i) != s.charAt(i)) {
        n01++;
      }
    } {
      if (pat.charAt(i) != s.charAt(i)) {
        n01++;
      }
    } if (pat.charAt(i) != s.charAt(i)) {
        n01++;
      } pat.charAt(i) != s.charAt(i) pat.charAt(i) pat.charAt pat i s.charAt(i) s.charAt s i {
        n01++;
      } n01++ n01 for (int i = 0; i < s.length(); i++) {
      if (pat.charAt(i + 1) != s.charAt(i)) {
        n10++;
      }
    } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
      if (pat.charAt(i + 1) != s.charAt(i)) {
        n10++;
      }
    } {
      if (pat.charAt(i + 1) != s.charAt(i)) {
        n10++;
      }
    } if (pat.charAt(i + 1) != s.charAt(i)) {
        n10++;
      } pat.charAt(i + 1) != s.charAt(i) pat.charAt(i + 1) pat.charAt pat i + 1 i 1 s.charAt(i) s.charAt s i {
        n10++;
      } n10++ n10 System.out.println(Math.min(n01, n10)) System.out.println System.out System System.out Math.min(n01, n10) Math.min Math n01 n10 String[] args args public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);

    String pat = "";
    for (int i = 0; i < 50001; i++) {
      pat += "01";
    }

    String s = sc.next();
    int n01 = 0;
    int n10 = 0;

    for (int i = 0; i < s.length(); i++) {
      if (pat.charAt(i) != s.charAt(i)) {
        n01++;
      }
    }

    for (int i = 0; i < s.length(); i++) {
      if (pat.charAt(i + 1) != s.charAt(i)) {
        n10++;
      }
    }

    System.out.println(Math.min(n01, n10));

  }
} public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);

    String pat = "";
    for (int i = 0; i < 50001; i++) {
      pat += "01";
    }

    String s = sc.next();
    int n01 = 0;
    int n10 = 0;

    for (int i = 0; i < s.length(); i++) {
      if (pat.charAt(i) != s.charAt(i)) {
        n01++;
      }
    }

    for (int i = 0; i < s.length(); i++) {
      if (pat.charAt(i + 1) != s.charAt(i)) {
        n10++;
      }
    }

    System.out.println(Math.min(n01, n10));

  }
} Main
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);

    String pat = "";
    for (int i = 0; i < 50001; i++) {
      pat += "01";
    }

    String s = sc.next();
    int n01 = 0;
    int n10 = 0;

    for (int i = 0; i < s.length(); i++) {
      if (pat.charAt(i) != s.charAt(i)) {
        n01++;
      }
    }

    for (int i = 0; i < s.length(); i++) {
      if (pat.charAt(i + 1) != s.charAt(i)) {
        n10++;
      }
    }

    System.out.println(Math.min(n01, n10));

  }
}