import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner scn = new Scanner(System.in);

    String S = scn.nextLine();
    char[] tile = S.toCharArray();

    char[] model1 = new char[tile.length];
    char[] model2 = new char[tile.length];
    for (int i = 0; i < tile.length; i++) {
      model1[i] = String.valueOf(i % 2).toCharArray()[0];
      model2[i] = String.valueOf((i + 1) % 2).toCharArray()[0];
    }

    System.out.println(Math.min(countDiffernce(tile, model1), countDiffernce(tile, model2)));
  }

  public static int countDiffernce(char[] str1, char[] str2) {
    int count = 0;
    for (int i = 0; i < str1.length; i++) {
      if (str1[i] != str2[i]) {
        count++;
      }
    }
    return count;
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner scn = new Scanner(System.in);

    String S = scn.nextLine();
    char[] tile = S.toCharArray();

    char[] model1 = new char[tile.length];
    char[] model2 = new char[tile.length];
    for (int i = 0; i < tile.length; i++) {
      model1[i] = String.valueOf(i % 2).toCharArray()[0];
      model2[i] = String.valueOf((i + 1) % 2).toCharArray()[0];
    }

    System.out.println(Math.min(countDiffernce(tile, model1), countDiffernce(tile, model2)));
  }

  public static int countDiffernce(char[] str1, char[] str2) {
    int count = 0;
    for (int i = 0; i < str1.length; i++) {
      if (str1[i] != str2[i]) {
        count++;
      }
    }
    return count;
  }
} Main public static void main(String[] args) {
    Scanner scn = new Scanner(System.in);

    String S = scn.nextLine();
    char[] tile = S.toCharArray();

    char[] model1 = new char[tile.length];
    char[] model2 = new char[tile.length];
    for (int i = 0; i < tile.length; i++) {
      model1[i] = String.valueOf(i % 2).toCharArray()[0];
      model2[i] = String.valueOf((i + 1) % 2).toCharArray()[0];
    }

    System.out.println(Math.min(countDiffernce(tile, model1), countDiffernce(tile, model2)));
  } main {
    Scanner scn = new Scanner(System.in);

    String S = scn.nextLine();
    char[] tile = S.toCharArray();

    char[] model1 = new char[tile.length];
    char[] model2 = new char[tile.length];
    for (int i = 0; i < tile.length; i++) {
      model1[i] = String.valueOf(i % 2).toCharArray()[0];
      model2[i] = String.valueOf((i + 1) % 2).toCharArray()[0];
    }

    System.out.println(Math.min(countDiffernce(tile, model1), countDiffernce(tile, model2)));
  } Scanner scn = new Scanner(System.in); scn new Scanner(System.in) String S = scn.nextLine(); S scn.nextLine() scn.nextLine scn char[] tile = S.toCharArray(); tile S.toCharArray() S.toCharArray S char[] model1 = new char[tile.length]; model1 new char[tile.length] tile.length tile tile.length char[] model2 = new char[tile.length]; model2 new char[tile.length] tile.length tile tile.length for (int i = 0; i < tile.length; i++) {
      model1[i] = String.valueOf(i % 2).toCharArray()[0];
      model2[i] = String.valueOf((i + 1) % 2).toCharArray()[0];
    } int i = 0; int i = 0; i 0 i < tile.length i tile.length tile tile.length i++ i++ i {
      model1[i] = String.valueOf(i % 2).toCharArray()[0];
      model2[i] = String.valueOf((i + 1) % 2).toCharArray()[0];
    } {
      model1[i] = String.valueOf(i % 2).toCharArray()[0];
      model2[i] = String.valueOf((i + 1) % 2).toCharArray()[0];
    } model1[i] = String.valueOf(i % 2).toCharArray()[0] model1[i] model1 i String.valueOf(i % 2).toCharArray()[0] String.valueOf(i % 2).toCharArray() String.valueOf(i % 2).toCharArray String.valueOf(i % 2) String.valueOf String i % 2 i 2 0 model2[i] = String.valueOf((i + 1) % 2).toCharArray()[0] model2[i] model2 i String.valueOf((i + 1) % 2).toCharArray()[0] String.valueOf((i + 1) % 2).toCharArray() String.valueOf((i + 1) % 2).toCharArray String.valueOf((i + 1) % 2) String.valueOf String (i + 1) % 2 (i + 1) i 1 2 0 System.out.println(Math.min(countDiffernce(tile, model1), countDiffernce(tile, model2))) System.out.println System.out System System.out Math.min(countDiffernce(tile, model1), countDiffernce(tile, model2)) Math.min Math countDiffernce(tile, model1) countDiffernce tile model1 countDiffernce(tile, model2) countDiffernce tile model2 String[] args args public static int countDiffernce(char[] str1, char[] str2) {
    int count = 0;
    for (int i = 0; i < str1.length; i++) {
      if (str1[i] != str2[i]) {
        count++;
      }
    }
    return count;
  } countDiffernce {
    int count = 0;
    for (int i = 0; i < str1.length; i++) {
      if (str1[i] != str2[i]) {
        count++;
      }
    }
    return count;
  } int count = 0; count 0 for (int i = 0; i < str1.length; i++) {
      if (str1[i] != str2[i]) {
        count++;
      }
    } int i = 0; int i = 0; i 0 i < str1.length i str1.length str1 str1.length i++ i++ i {
      if (str1[i] != str2[i]) {
        count++;
      }
    } {
      if (str1[i] != str2[i]) {
        count++;
      }
    } if (str1[i] != str2[i]) {
        count++;
      } str1[i] != str2[i] str1[i] str1 i str2[i] str2 i {
        count++;
      } count++ count return count; count char[] str1 str1 char[] str2 str2 public class Main {
  public static void main(String[] args) {
    Scanner scn = new Scanner(System.in);

    String S = scn.nextLine();
    char[] tile = S.toCharArray();

    char[] model1 = new char[tile.length];
    char[] model2 = new char[tile.length];
    for (int i = 0; i < tile.length; i++) {
      model1[i] = String.valueOf(i % 2).toCharArray()[0];
      model2[i] = String.valueOf((i + 1) % 2).toCharArray()[0];
    }

    System.out.println(Math.min(countDiffernce(tile, model1), countDiffernce(tile, model2)));
  }

  public static int countDiffernce(char[] str1, char[] str2) {
    int count = 0;
    for (int i = 0; i < str1.length; i++) {
      if (str1[i] != str2[i]) {
        count++;
      }
    }
    return count;
  }
} public class Main {
  public static void main(String[] args) {
    Scanner scn = new Scanner(System.in);

    String S = scn.nextLine();
    char[] tile = S.toCharArray();

    char[] model1 = new char[tile.length];
    char[] model2 = new char[tile.length];
    for (int i = 0; i < tile.length; i++) {
      model1[i] = String.valueOf(i % 2).toCharArray()[0];
      model2[i] = String.valueOf((i + 1) % 2).toCharArray()[0];
    }

    System.out.println(Math.min(countDiffernce(tile, model1), countDiffernce(tile, model2)));
  }

  public static int countDiffernce(char[] str1, char[] str2) {
    int count = 0;
    for (int i = 0; i < str1.length; i++) {
      if (str1[i] != str2[i]) {
        count++;
      }
    }
    return count;
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner scn = new Scanner(System.in);

    String S = scn.nextLine();
    char[] tile = S.toCharArray();

    char[] model1 = new char[tile.length];
    char[] model2 = new char[tile.length];
    for (int i = 0; i < tile.length; i++) {
      model1[i] = String.valueOf(i % 2).toCharArray()[0];
      model2[i] = String.valueOf((i + 1) % 2).toCharArray()[0];
    }

    System.out.println(Math.min(countDiffernce(tile, model1), countDiffernce(tile, model2)));
  }

  public static int countDiffernce(char[] str1, char[] str2) {
    int count = 0;
    for (int i = 0; i < str1.length; i++) {
      if (str1[i] != str2[i]) {
        count++;
      }
    }
    return count;
  }
}