import java.util.*;
import java.util.stream.*;

public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    char[] S = in.nextLine().toCharArray();
    int one = 0, zero = 0;
    for (int i = 0; i < S.length; i++) {
      if (i % 2 == 0) {
        if (S[i] == '0') {
          one++;
        } else {
          zero++;
        }
      } else {
        if (S[i] == '1') {
          one++;
        } else {
          zero++;
        }
      }
    }
    System.out.println(Math.min(one, zero));
  }
} import java.util.*; util.* java import java.util.stream.*; stream.* java.util public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    char[] S = in.nextLine().toCharArray();
    int one = 0, zero = 0;
    for (int i = 0; i < S.length; i++) {
      if (i % 2 == 0) {
        if (S[i] == '0') {
          one++;
        } else {
          zero++;
        }
      } else {
        if (S[i] == '1') {
          one++;
        } else {
          zero++;
        }
      }
    }
    System.out.println(Math.min(one, zero));
  }
} Main public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    char[] S = in.nextLine().toCharArray();
    int one = 0, zero = 0;
    for (int i = 0; i < S.length; i++) {
      if (i % 2 == 0) {
        if (S[i] == '0') {
          one++;
        } else {
          zero++;
        }
      } else {
        if (S[i] == '1') {
          one++;
        } else {
          zero++;
        }
      }
    }
    System.out.println(Math.min(one, zero));
  } main {
    Scanner in = new Scanner(System.in);
    char[] S = in.nextLine().toCharArray();
    int one = 0, zero = 0;
    for (int i = 0; i < S.length; i++) {
      if (i % 2 == 0) {
        if (S[i] == '0') {
          one++;
        } else {
          zero++;
        }
      } else {
        if (S[i] == '1') {
          one++;
        } else {
          zero++;
        }
      }
    }
    System.out.println(Math.min(one, zero));
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) char[] S = in.nextLine().toCharArray(); S in.nextLine().toCharArray() in.nextLine().toCharArray in.nextLine() in.nextLine in int one = 0 one 0 zero = 0; zero 0 for (int i = 0; i < S.length; i++) {
      if (i % 2 == 0) {
        if (S[i] == '0') {
          one++;
        } else {
          zero++;
        }
      } else {
        if (S[i] == '1') {
          one++;
        } else {
          zero++;
        }
      }
    } 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] == '0') {
          one++;
        } else {
          zero++;
        }
      } else {
        if (S[i] == '1') {
          one++;
        } else {
          zero++;
        }
      }
    } {
      if (i % 2 == 0) {
        if (S[i] == '0') {
          one++;
        } else {
          zero++;
        }
      } else {
        if (S[i] == '1') {
          one++;
        } else {
          zero++;
        }
      }
    } if (i % 2 == 0) {
        if (S[i] == '0') {
          one++;
        } else {
          zero++;
        }
      } else {
        if (S[i] == '1') {
          one++;
        } else {
          zero++;
        }
      } i % 2 == 0 i % 2 i 2 0 {
        if (S[i] == '0') {
          one++;
        } else {
          zero++;
        }
      } if (S[i] == '0') {
          one++;
        } else {
          zero++;
        } S[i] == '0' S[i] S i '0' {
          one++;
        } one++ one {
          zero++;
        } zero++ zero {
        if (S[i] == '1') {
          one++;
        } else {
          zero++;
        }
      } if (S[i] == '1') {
          one++;
        } else {
          zero++;
        } S[i] == '1' S[i] S i '1' {
          one++;
        } one++ one {
          zero++;
        } zero++ zero System.out.println(Math.min(one, zero)) System.out.println System.out System System.out Math.min(one, zero) Math.min Math one zero String[] args args public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    char[] S = in.nextLine().toCharArray();
    int one = 0, zero = 0;
    for (int i = 0; i < S.length; i++) {
      if (i % 2 == 0) {
        if (S[i] == '0') {
          one++;
        } else {
          zero++;
        }
      } else {
        if (S[i] == '1') {
          one++;
        } else {
          zero++;
        }
      }
    }
    System.out.println(Math.min(one, zero));
  }
} public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    char[] S = in.nextLine().toCharArray();
    int one = 0, zero = 0;
    for (int i = 0; i < S.length; i++) {
      if (i % 2 == 0) {
        if (S[i] == '0') {
          one++;
        } else {
          zero++;
        }
      } else {
        if (S[i] == '1') {
          one++;
        } else {
          zero++;
        }
      }
    }
    System.out.println(Math.min(one, zero));
  }
} Main
import java.util.*;
import java.util.stream.*;

public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    char[] S = in.nextLine().toCharArray();
    int one = 0, zero = 0;
    for (int i = 0; i < S.length; i++) {
      if (i % 2 == 0) {
        if (S[i] == '0') {
          one++;
        } else {
          zero++;
        }
      } else {
        if (S[i] == '1') {
          one++;
        } else {
          zero++;
        }
      }
    }
    System.out.println(Math.min(one, zero));
  }
}