import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
      	String a = sc.next();
      	char[] S = new char[a.length()];
      	for (int i=0; i<a.length(); i++){
          S[i] = a.charAt(i);
        }
		int counter = 0;
      	char key = S[0];
      	for (int i=0; i<a.length(); i++){
          if (key != S[i]){
            counter++;
          }
          if(key == '0'){
            key = '1';
          }else{
            key = '0';
          }
        }
      	System.out.println(counter);
    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
      	String a = sc.next();
      	char[] S = new char[a.length()];
      	for (int i=0; i<a.length(); i++){
          S[i] = a.charAt(i);
        }
		int counter = 0;
      	char key = S[0];
      	for (int i=0; i<a.length(); i++){
          if (key != S[i]){
            counter++;
          }
          if(key == '0'){
            key = '1';
          }else{
            key = '0';
          }
        }
      	System.out.println(counter);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
      	String a = sc.next();
      	char[] S = new char[a.length()];
      	for (int i=0; i<a.length(); i++){
          S[i] = a.charAt(i);
        }
		int counter = 0;
      	char key = S[0];
      	for (int i=0; i<a.length(); i++){
          if (key != S[i]){
            counter++;
          }
          if(key == '0'){
            key = '1';
          }else{
            key = '0';
          }
        }
      	System.out.println(counter);
    } main {
        Scanner sc = new Scanner(System.in);
      	String a = sc.next();
      	char[] S = new char[a.length()];
      	for (int i=0; i<a.length(); i++){
          S[i] = a.charAt(i);
        }
		int counter = 0;
      	char key = S[0];
      	for (int i=0; i<a.length(); i++){
          if (key != S[i]){
            counter++;
          }
          if(key == '0'){
            key = '1';
          }else{
            key = '0';
          }
        }
      	System.out.println(counter);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String a = sc.next(); a sc.next() sc.next sc char[] S = new char[a.length()]; S new char[a.length()] a.length() a.length a for (int i=0; i<a.length(); i++){
          S[i] = a.charAt(i);
        } int i=0; int i=0; i 0 i<a.length() i a.length() a.length a i++ i++ i {
          S[i] = a.charAt(i);
        } {
          S[i] = a.charAt(i);
        } S[i] = a.charAt(i) S[i] S i a.charAt(i) a.charAt a i int counter = 0; counter 0 char key = S[0]; key S[0] S 0 for (int i=0; i<a.length(); i++){
          if (key != S[i]){
            counter++;
          }
          if(key == '0'){
            key = '1';
          }else{
            key = '0';
          }
        } int i=0; int i=0; i 0 i<a.length() i a.length() a.length a i++ i++ i {
          if (key != S[i]){
            counter++;
          }
          if(key == '0'){
            key = '1';
          }else{
            key = '0';
          }
        } {
          if (key != S[i]){
            counter++;
          }
          if(key == '0'){
            key = '1';
          }else{
            key = '0';
          }
        } if (key != S[i]){
            counter++;
          } key != S[i] key S[i] S i {
            counter++;
          } counter++ counter if(key == '0'){
            key = '1';
          }else{
            key = '0';
          } key == '0' key '0' {
            key = '1';
          } key = '1' key '1' {
            key = '0';
          } key = '0' key '0' System.out.println(counter) System.out.println System.out System System.out counter String[] args args
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
      	String a = sc.next();
      	char[] S = new char[a.length()];
      	for (int i=0; i<a.length(); i++){
          S[i] = a.charAt(i);
        }
		int counter = 0;
      	char key = S[0];
      	for (int i=0; i<a.length(); i++){
          if (key != S[i]){
            counter++;
          }
          if(key == '0'){
            key = '1';
          }else{
            key = '0';
          }
        }
      	System.out.println(counter);
    }
}