import java.util.Scanner;
import java.util.Arrays;

public class Main{
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    String S=scanner.next();
    String[] strArray = new String[S.length()];
    String[] strArray2 = new String[S.length()];
    int ans1=0;
    int ans2=0;

    for (int i = 0; i < S.length(); i++) {
      String str2 = String.valueOf(S.charAt(i));
      strArray[i] = str2;
    }

    System.arraycopy(strArray,0,strArray2,0,S.length());

    for(int i=0;i<S.length(); i++){
      if(i%2==0){
        if(strArray[i].equals("1")) ans1++;
        if(strArray[i].equals("0")) ans2++;
      }
      else{
        if(strArray[i].equals("0")) ans1++;
        if(strArray[i].equals("1")) ans2++;
      }
    }

    if(ans1<ans2) System.out.println(ans1);
    else System.out.println(ans2);
  }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util public class Main{
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    String S=scanner.next();
    String[] strArray = new String[S.length()];
    String[] strArray2 = new String[S.length()];
    int ans1=0;
    int ans2=0;

    for (int i = 0; i < S.length(); i++) {
      String str2 = String.valueOf(S.charAt(i));
      strArray[i] = str2;
    }

    System.arraycopy(strArray,0,strArray2,0,S.length());

    for(int i=0;i<S.length(); i++){
      if(i%2==0){
        if(strArray[i].equals("1")) ans1++;
        if(strArray[i].equals("0")) ans2++;
      }
      else{
        if(strArray[i].equals("0")) ans1++;
        if(strArray[i].equals("1")) ans2++;
      }
    }

    if(ans1<ans2) System.out.println(ans1);
    else System.out.println(ans2);
  }
} Main public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    String S=scanner.next();
    String[] strArray = new String[S.length()];
    String[] strArray2 = new String[S.length()];
    int ans1=0;
    int ans2=0;

    for (int i = 0; i < S.length(); i++) {
      String str2 = String.valueOf(S.charAt(i));
      strArray[i] = str2;
    }

    System.arraycopy(strArray,0,strArray2,0,S.length());

    for(int i=0;i<S.length(); i++){
      if(i%2==0){
        if(strArray[i].equals("1")) ans1++;
        if(strArray[i].equals("0")) ans2++;
      }
      else{
        if(strArray[i].equals("0")) ans1++;
        if(strArray[i].equals("1")) ans2++;
      }
    }

    if(ans1<ans2) System.out.println(ans1);
    else System.out.println(ans2);
  } main {
    Scanner scanner = new Scanner(System.in);
    String S=scanner.next();
    String[] strArray = new String[S.length()];
    String[] strArray2 = new String[S.length()];
    int ans1=0;
    int ans2=0;

    for (int i = 0; i < S.length(); i++) {
      String str2 = String.valueOf(S.charAt(i));
      strArray[i] = str2;
    }

    System.arraycopy(strArray,0,strArray2,0,S.length());

    for(int i=0;i<S.length(); i++){
      if(i%2==0){
        if(strArray[i].equals("1")) ans1++;
        if(strArray[i].equals("0")) ans2++;
      }
      else{
        if(strArray[i].equals("0")) ans1++;
        if(strArray[i].equals("1")) ans2++;
      }
    }

    if(ans1<ans2) System.out.println(ans1);
    else System.out.println(ans2);
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String S=scanner.next(); S scanner.next() scanner.next scanner String[] strArray = new String[S.length()]; strArray new String[S.length()] S.length() S.length S String[] strArray2 = new String[S.length()]; strArray2 new String[S.length()] S.length() S.length S int ans1=0; ans1 0 int ans2=0; ans2 0 for (int i = 0; i < S.length(); i++) {
      String str2 = String.valueOf(S.charAt(i));
      strArray[i] = str2;
    } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
      String str2 = String.valueOf(S.charAt(i));
      strArray[i] = str2;
    } {
      String str2 = String.valueOf(S.charAt(i));
      strArray[i] = str2;
    } String str2 = String.valueOf(S.charAt(i)); str2 String.valueOf(S.charAt(i)) String.valueOf String S.charAt(i) S.charAt S i strArray[i] = str2 strArray[i] strArray i str2 System.arraycopy(strArray,0,strArray2,0,S.length()) System.arraycopy System strArray 0 strArray2 0 S.length() S.length S for(int i=0;i<S.length(); i++){
      if(i%2==0){
        if(strArray[i].equals("1")) ans1++;
        if(strArray[i].equals("0")) ans2++;
      }
      else{
        if(strArray[i].equals("0")) ans1++;
        if(strArray[i].equals("1")) ans2++;
      }
    } int i=0; int i=0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
      if(i%2==0){
        if(strArray[i].equals("1")) ans1++;
        if(strArray[i].equals("0")) ans2++;
      }
      else{
        if(strArray[i].equals("0")) ans1++;
        if(strArray[i].equals("1")) ans2++;
      }
    } {
      if(i%2==0){
        if(strArray[i].equals("1")) ans1++;
        if(strArray[i].equals("0")) ans2++;
      }
      else{
        if(strArray[i].equals("0")) ans1++;
        if(strArray[i].equals("1")) ans2++;
      }
    } if(i%2==0){
        if(strArray[i].equals("1")) ans1++;
        if(strArray[i].equals("0")) ans2++;
      }
      else{
        if(strArray[i].equals("0")) ans1++;
        if(strArray[i].equals("1")) ans2++;
      } i%2==0 i%2 i 2 0 {
        if(strArray[i].equals("1")) ans1++;
        if(strArray[i].equals("0")) ans2++;
      } if(strArray[i].equals("1")) ans1++; strArray[i].equals("1") strArray[i].equals strArray[i] strArray i "1" ans1++ ans1 if(strArray[i].equals("0")) ans2++; strArray[i].equals("0") strArray[i].equals strArray[i] strArray i "0" ans2++ ans2 {
        if(strArray[i].equals("0")) ans1++;
        if(strArray[i].equals("1")) ans2++;
      } if(strArray[i].equals("0")) ans1++; strArray[i].equals("0") strArray[i].equals strArray[i] strArray i "0" ans1++ ans1 if(strArray[i].equals("1")) ans2++; strArray[i].equals("1") strArray[i].equals strArray[i] strArray i "1" ans2++ ans2 if(ans1<ans2) System.out.println(ans1);
    else System.out.println(ans2); ans1<ans2 ans1 ans2 System.out.println(ans1) System.out.println System.out System System.out ans1 System.out.println(ans2) System.out.println System.out System System.out ans2 String[] args args public class Main{
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    String S=scanner.next();
    String[] strArray = new String[S.length()];
    String[] strArray2 = new String[S.length()];
    int ans1=0;
    int ans2=0;

    for (int i = 0; i < S.length(); i++) {
      String str2 = String.valueOf(S.charAt(i));
      strArray[i] = str2;
    }

    System.arraycopy(strArray,0,strArray2,0,S.length());

    for(int i=0;i<S.length(); i++){
      if(i%2==0){
        if(strArray[i].equals("1")) ans1++;
        if(strArray[i].equals("0")) ans2++;
      }
      else{
        if(strArray[i].equals("0")) ans1++;
        if(strArray[i].equals("1")) ans2++;
      }
    }

    if(ans1<ans2) System.out.println(ans1);
    else System.out.println(ans2);
  }
} public class Main{
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    String S=scanner.next();
    String[] strArray = new String[S.length()];
    String[] strArray2 = new String[S.length()];
    int ans1=0;
    int ans2=0;

    for (int i = 0; i < S.length(); i++) {
      String str2 = String.valueOf(S.charAt(i));
      strArray[i] = str2;
    }

    System.arraycopy(strArray,0,strArray2,0,S.length());

    for(int i=0;i<S.length(); i++){
      if(i%2==0){
        if(strArray[i].equals("1")) ans1++;
        if(strArray[i].equals("0")) ans2++;
      }
      else{
        if(strArray[i].equals("0")) ans1++;
        if(strArray[i].equals("1")) ans2++;
      }
    }

    if(ans1<ans2) System.out.println(ans1);
    else System.out.println(ans2);
  }
} Main
import java.util.Scanner;
import java.util.Arrays;

public class Main{
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    String S=scanner.next();
    String[] strArray = new String[S.length()];
    String[] strArray2 = new String[S.length()];
    int ans1=0;
    int ans2=0;

    for (int i = 0; i < S.length(); i++) {
      String str2 = String.valueOf(S.charAt(i));
      strArray[i] = str2;
    }

    System.arraycopy(strArray,0,strArray2,0,S.length());

    for(int i=0;i<S.length(); i++){
      if(i%2==0){
        if(strArray[i].equals("1")) ans1++;
        if(strArray[i].equals("0")) ans2++;
      }
      else{
        if(strArray[i].equals("0")) ans1++;
        if(strArray[i].equals("1")) ans2++;
      }
    }

    if(ans1<ans2) System.out.println(ans1);
    else System.out.println(ans2);
  }
}
