import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    String s = scan.next();
    int n = s.length();
    int sum1 = 0;
    int sum2 = 0;
      sum1 = 0;
      for (int i=0;i<n;i++){
        if (s.charAt(i) == '0'){
          if (i%2 == 1){
            sum1 += 1;
          }
        }
        else{
          if (i%2 == 0){
            sum1 += 1;
          }
        }
      }

      sum2 = 0;
      for (int i=0;i<n;i++){
        if (s.charAt(i) == '0'){
          if (i%2 == 0){
            sum2 += 1;
          }
        }
        else{
          if (i%2 == 1){
            sum2 += 1;
          }
        }
      }


    System.out.println(Math.min(sum1,sum2));
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    String s = scan.next();
    int n = s.length();
    int sum1 = 0;
    int sum2 = 0;
      sum1 = 0;
      for (int i=0;i<n;i++){
        if (s.charAt(i) == '0'){
          if (i%2 == 1){
            sum1 += 1;
          }
        }
        else{
          if (i%2 == 0){
            sum1 += 1;
          }
        }
      }

      sum2 = 0;
      for (int i=0;i<n;i++){
        if (s.charAt(i) == '0'){
          if (i%2 == 0){
            sum2 += 1;
          }
        }
        else{
          if (i%2 == 1){
            sum2 += 1;
          }
        }
      }


    System.out.println(Math.min(sum1,sum2));
  }
} Main public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    String s = scan.next();
    int n = s.length();
    int sum1 = 0;
    int sum2 = 0;
      sum1 = 0;
      for (int i=0;i<n;i++){
        if (s.charAt(i) == '0'){
          if (i%2 == 1){
            sum1 += 1;
          }
        }
        else{
          if (i%2 == 0){
            sum1 += 1;
          }
        }
      }

      sum2 = 0;
      for (int i=0;i<n;i++){
        if (s.charAt(i) == '0'){
          if (i%2 == 0){
            sum2 += 1;
          }
        }
        else{
          if (i%2 == 1){
            sum2 += 1;
          }
        }
      }


    System.out.println(Math.min(sum1,sum2));
  } main {
    Scanner scan = new Scanner(System.in);
    String s = scan.next();
    int n = s.length();
    int sum1 = 0;
    int sum2 = 0;
      sum1 = 0;
      for (int i=0;i<n;i++){
        if (s.charAt(i) == '0'){
          if (i%2 == 1){
            sum1 += 1;
          }
        }
        else{
          if (i%2 == 0){
            sum1 += 1;
          }
        }
      }

      sum2 = 0;
      for (int i=0;i<n;i++){
        if (s.charAt(i) == '0'){
          if (i%2 == 0){
            sum2 += 1;
          }
        }
        else{
          if (i%2 == 1){
            sum2 += 1;
          }
        }
      }


    System.out.println(Math.min(sum1,sum2));
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String s = scan.next(); s scan.next() scan.next scan int n = s.length(); n s.length() s.length s int sum1 = 0; sum1 0 int sum2 = 0; sum2 0 sum1 = 0 sum1 0 for (int i=0;i<n;i++){
        if (s.charAt(i) == '0'){
          if (i%2 == 1){
            sum1 += 1;
          }
        }
        else{
          if (i%2 == 0){
            sum1 += 1;
          }
        }
      } int i=0; int i=0; i 0 i<n i n i++ i++ i {
        if (s.charAt(i) == '0'){
          if (i%2 == 1){
            sum1 += 1;
          }
        }
        else{
          if (i%2 == 0){
            sum1 += 1;
          }
        }
      } {
        if (s.charAt(i) == '0'){
          if (i%2 == 1){
            sum1 += 1;
          }
        }
        else{
          if (i%2 == 0){
            sum1 += 1;
          }
        }
      } if (s.charAt(i) == '0'){
          if (i%2 == 1){
            sum1 += 1;
          }
        }
        else{
          if (i%2 == 0){
            sum1 += 1;
          }
        } s.charAt(i) == '0' s.charAt(i) s.charAt s i '0' {
          if (i%2 == 1){
            sum1 += 1;
          }
        } if (i%2 == 1){
            sum1 += 1;
          } i%2 == 1 i%2 i 2 1 {
            sum1 += 1;
          } sum1 += 1 sum1 1 {
          if (i%2 == 0){
            sum1 += 1;
          }
        } if (i%2 == 0){
            sum1 += 1;
          } i%2 == 0 i%2 i 2 0 {
            sum1 += 1;
          } sum1 += 1 sum1 1 sum2 = 0 sum2 0 for (int i=0;i<n;i++){
        if (s.charAt(i) == '0'){
          if (i%2 == 0){
            sum2 += 1;
          }
        }
        else{
          if (i%2 == 1){
            sum2 += 1;
          }
        }
      } int i=0; int i=0; i 0 i<n i n i++ i++ i {
        if (s.charAt(i) == '0'){
          if (i%2 == 0){
            sum2 += 1;
          }
        }
        else{
          if (i%2 == 1){
            sum2 += 1;
          }
        }
      } {
        if (s.charAt(i) == '0'){
          if (i%2 == 0){
            sum2 += 1;
          }
        }
        else{
          if (i%2 == 1){
            sum2 += 1;
          }
        }
      } if (s.charAt(i) == '0'){
          if (i%2 == 0){
            sum2 += 1;
          }
        }
        else{
          if (i%2 == 1){
            sum2 += 1;
          }
        } s.charAt(i) == '0' s.charAt(i) s.charAt s i '0' {
          if (i%2 == 0){
            sum2 += 1;
          }
        } if (i%2 == 0){
            sum2 += 1;
          } i%2 == 0 i%2 i 2 0 {
            sum2 += 1;
          } sum2 += 1 sum2 1 {
          if (i%2 == 1){
            sum2 += 1;
          }
        } if (i%2 == 1){
            sum2 += 1;
          } i%2 == 1 i%2 i 2 1 {
            sum2 += 1;
          } sum2 += 1 sum2 1 System.out.println(Math.min(sum1,sum2)) System.out.println System.out System System.out Math.min(sum1,sum2) Math.min Math sum1 sum2 String[] args args public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    String s = scan.next();
    int n = s.length();
    int sum1 = 0;
    int sum2 = 0;
      sum1 = 0;
      for (int i=0;i<n;i++){
        if (s.charAt(i) == '0'){
          if (i%2 == 1){
            sum1 += 1;
          }
        }
        else{
          if (i%2 == 0){
            sum1 += 1;
          }
        }
      }

      sum2 = 0;
      for (int i=0;i<n;i++){
        if (s.charAt(i) == '0'){
          if (i%2 == 0){
            sum2 += 1;
          }
        }
        else{
          if (i%2 == 1){
            sum2 += 1;
          }
        }
      }


    System.out.println(Math.min(sum1,sum2));
  }
} public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    String s = scan.next();
    int n = s.length();
    int sum1 = 0;
    int sum2 = 0;
      sum1 = 0;
      for (int i=0;i<n;i++){
        if (s.charAt(i) == '0'){
          if (i%2 == 1){
            sum1 += 1;
          }
        }
        else{
          if (i%2 == 0){
            sum1 += 1;
          }
        }
      }

      sum2 = 0;
      for (int i=0;i<n;i++){
        if (s.charAt(i) == '0'){
          if (i%2 == 0){
            sum2 += 1;
          }
        }
        else{
          if (i%2 == 1){
            sum2 += 1;
          }
        }
      }


    System.out.println(Math.min(sum1,sum2));
  }
} Main
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    String s = scan.next();
    int n = s.length();
    int sum1 = 0;
    int sum2 = 0;
      sum1 = 0;
      for (int i=0;i<n;i++){
        if (s.charAt(i) == '0'){
          if (i%2 == 1){
            sum1 += 1;
          }
        }
        else{
          if (i%2 == 0){
            sum1 += 1;
          }
        }
      }

      sum2 = 0;
      for (int i=0;i<n;i++){
        if (s.charAt(i) == '0'){
          if (i%2 == 0){
            sum2 += 1;
          }
        }
        else{
          if (i%2 == 1){
            sum2 += 1;
          }
        }
      }


    System.out.println(Math.min(sum1,sum2));
  }
}
