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[] arr = S.split("");

    int countA = 0;

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

    }

    int countB = 0;

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

    }

    if (countA < countB) {
      System.out.println(countA);
    } else {
      System.out.println(countB);
    }
    
  }

} 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[] arr = S.split("");

    int countA = 0;

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

    }

    int countB = 0;

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

    }

    if (countA < countB) {
      System.out.println(countA);
    } else {
      System.out.println(countB);
    }
    
  }

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

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

    sc.close();

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

    int countA = 0;

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

    }

    int countB = 0;

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

    }

    if (countA < countB) {
      System.out.println(countA);
    } else {
      System.out.println(countB);
    }
    
  } main {

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

    sc.close();

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

    int countA = 0;

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

    }

    int countB = 0;

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

    }

    if (countA < countB) {
      System.out.println(countA);
    } else {
      System.out.println(countB);
    }
    
  } 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[] arr = S.split(""); arr S.split("") S.split S "" int countA = 0; countA 0 for (int i = 0; i < arr.length; i++) {
      
      if (i % 2 == 0) {
        if (arr[i].equals("1")) {
          countA++;
        }
      } else {
        if (arr[i].equals("0")) {
          countA++;
        }
      }

    } int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i {
      
      if (i % 2 == 0) {
        if (arr[i].equals("1")) {
          countA++;
        }
      } else {
        if (arr[i].equals("0")) {
          countA++;
        }
      }

    } {
      
      if (i % 2 == 0) {
        if (arr[i].equals("1")) {
          countA++;
        }
      } else {
        if (arr[i].equals("0")) {
          countA++;
        }
      }

    } if (i % 2 == 0) {
        if (arr[i].equals("1")) {
          countA++;
        }
      } else {
        if (arr[i].equals("0")) {
          countA++;
        }
      } i % 2 == 0 i % 2 i 2 0 {
        if (arr[i].equals("1")) {
          countA++;
        }
      } if (arr[i].equals("1")) {
          countA++;
        } arr[i].equals("1") arr[i].equals arr[i] arr i "1" {
          countA++;
        } countA++ countA {
        if (arr[i].equals("0")) {
          countA++;
        }
      } if (arr[i].equals("0")) {
          countA++;
        } arr[i].equals("0") arr[i].equals arr[i] arr i "0" {
          countA++;
        } countA++ countA int countB = 0; countB 0 for (int i = 0; i < arr.length; i++) {
      
      if (i % 2 == 0) {
        if (arr[i].equals("0")) {
          countB++;
        }
      } else {
        if (arr[i].equals("1")) {
          countB++;
        }
      }

    } int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i {
      
      if (i % 2 == 0) {
        if (arr[i].equals("0")) {
          countB++;
        }
      } else {
        if (arr[i].equals("1")) {
          countB++;
        }
      }

    } {
      
      if (i % 2 == 0) {
        if (arr[i].equals("0")) {
          countB++;
        }
      } else {
        if (arr[i].equals("1")) {
          countB++;
        }
      }

    } if (i % 2 == 0) {
        if (arr[i].equals("0")) {
          countB++;
        }
      } else {
        if (arr[i].equals("1")) {
          countB++;
        }
      } i % 2 == 0 i % 2 i 2 0 {
        if (arr[i].equals("0")) {
          countB++;
        }
      } if (arr[i].equals("0")) {
          countB++;
        } arr[i].equals("0") arr[i].equals arr[i] arr i "0" {
          countB++;
        } countB++ countB {
        if (arr[i].equals("1")) {
          countB++;
        }
      } if (arr[i].equals("1")) {
          countB++;
        } arr[i].equals("1") arr[i].equals arr[i] arr i "1" {
          countB++;
        } countB++ countB if (countA < countB) {
      System.out.println(countA);
    } else {
      System.out.println(countB);
    } countA < countB countA countB {
      System.out.println(countA);
    } System.out.println(countA) System.out.println System.out System System.out countA {
      System.out.println(countB);
    } System.out.println(countB) System.out.println System.out System System.out countB 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[] arr = S.split("");

    int countA = 0;

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

    }

    int countB = 0;

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

    }

    if (countA < countB) {
      System.out.println(countA);
    } else {
      System.out.println(countB);
    }
    
  }

} public class Main {

  public static void main (String[] args) {

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

    sc.close();

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

    int countA = 0;

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

    }

    int countB = 0;

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

    }

    if (countA < countB) {
      System.out.println(countA);
    } else {
      System.out.println(countB);
    }
    
  }

} 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[] arr = S.split("");

    int countA = 0;

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

    }

    int countB = 0;

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

    }

    if (countA < countB) {
      System.out.println(countA);
    } else {
      System.out.println(countB);
    }
    
  }

}