import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    resolve(System.in, System.out);
  }

  static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    String line = sc.nextLine();
    int[] titles = new int[line.length()];
    int firstIs0ColoringCount = 0;
    int firstIs1ColoringCount = 0;
    for (int i = 0; i < line.length(); i++) {
      int current = Integer.parseInt(String.valueOf(line.charAt(i)));
      if (current == i % 2) {
        firstIs1ColoringCount++;
      } else {
        firstIs0ColoringCount++;
      }
    }
    pw.println(Math.min(firstIs0ColoringCount, firstIs1ColoringCount));
  }
} import java.io.InputStream; InputStream java.io import java.io.PrintStream; PrintStream java.io import java.util.Scanner; Scanner java.util public class Main {

  public static void main(String[] args) {
    resolve(System.in, System.out);
  }

  static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    String line = sc.nextLine();
    int[] titles = new int[line.length()];
    int firstIs0ColoringCount = 0;
    int firstIs1ColoringCount = 0;
    for (int i = 0; i < line.length(); i++) {
      int current = Integer.parseInt(String.valueOf(line.charAt(i)));
      if (current == i % 2) {
        firstIs1ColoringCount++;
      } else {
        firstIs0ColoringCount++;
      }
    }
    pw.println(Math.min(firstIs0ColoringCount, firstIs1ColoringCount));
  }
} Main public static void main(String[] args) {
    resolve(System.in, System.out);
  } main {
    resolve(System.in, System.out);
  } resolve(System.in, System.out) resolve System.in System System.in System.out System System.out String[] args args static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    String line = sc.nextLine();
    int[] titles = new int[line.length()];
    int firstIs0ColoringCount = 0;
    int firstIs1ColoringCount = 0;
    for (int i = 0; i < line.length(); i++) {
      int current = Integer.parseInt(String.valueOf(line.charAt(i)));
      if (current == i % 2) {
        firstIs1ColoringCount++;
      } else {
        firstIs0ColoringCount++;
      }
    }
    pw.println(Math.min(firstIs0ColoringCount, firstIs1ColoringCount));
  } resolve {
    Scanner sc = new Scanner(is);
    String line = sc.nextLine();
    int[] titles = new int[line.length()];
    int firstIs0ColoringCount = 0;
    int firstIs1ColoringCount = 0;
    for (int i = 0; i < line.length(); i++) {
      int current = Integer.parseInt(String.valueOf(line.charAt(i)));
      if (current == i % 2) {
        firstIs1ColoringCount++;
      } else {
        firstIs0ColoringCount++;
      }
    }
    pw.println(Math.min(firstIs0ColoringCount, firstIs1ColoringCount));
  } Scanner sc = new Scanner(is); sc new Scanner(is) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc int[] titles = new int[line.length()]; titles new int[line.length()] line.length() line.length line int firstIs0ColoringCount = 0; firstIs0ColoringCount 0 int firstIs1ColoringCount = 0; firstIs1ColoringCount 0 for (int i = 0; i < line.length(); i++) {
      int current = Integer.parseInt(String.valueOf(line.charAt(i)));
      if (current == i % 2) {
        firstIs1ColoringCount++;
      } else {
        firstIs0ColoringCount++;
      }
    } int i = 0; int i = 0; i 0 i < line.length() i line.length() line.length line i++ i++ i {
      int current = Integer.parseInt(String.valueOf(line.charAt(i)));
      if (current == i % 2) {
        firstIs1ColoringCount++;
      } else {
        firstIs0ColoringCount++;
      }
    } {
      int current = Integer.parseInt(String.valueOf(line.charAt(i)));
      if (current == i % 2) {
        firstIs1ColoringCount++;
      } else {
        firstIs0ColoringCount++;
      }
    } int current = Integer.parseInt(String.valueOf(line.charAt(i))); current Integer.parseInt(String.valueOf(line.charAt(i))) Integer.parseInt Integer String.valueOf(line.charAt(i)) String.valueOf String line.charAt(i) line.charAt line i if (current == i % 2) {
        firstIs1ColoringCount++;
      } else {
        firstIs0ColoringCount++;
      } current == i % 2 current i % 2 i 2 {
        firstIs1ColoringCount++;
      } firstIs1ColoringCount++ firstIs1ColoringCount {
        firstIs0ColoringCount++;
      } firstIs0ColoringCount++ firstIs0ColoringCount pw.println(Math.min(firstIs0ColoringCount, firstIs1ColoringCount)) pw.println pw Math.min(firstIs0ColoringCount, firstIs1ColoringCount) Math.min Math firstIs0ColoringCount firstIs1ColoringCount InputStream is is PrintStream pw pw public class Main {

  public static void main(String[] args) {
    resolve(System.in, System.out);
  }

  static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    String line = sc.nextLine();
    int[] titles = new int[line.length()];
    int firstIs0ColoringCount = 0;
    int firstIs1ColoringCount = 0;
    for (int i = 0; i < line.length(); i++) {
      int current = Integer.parseInt(String.valueOf(line.charAt(i)));
      if (current == i % 2) {
        firstIs1ColoringCount++;
      } else {
        firstIs0ColoringCount++;
      }
    }
    pw.println(Math.min(firstIs0ColoringCount, firstIs1ColoringCount));
  }
} public class Main {

  public static void main(String[] args) {
    resolve(System.in, System.out);
  }

  static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    String line = sc.nextLine();
    int[] titles = new int[line.length()];
    int firstIs0ColoringCount = 0;
    int firstIs1ColoringCount = 0;
    for (int i = 0; i < line.length(); i++) {
      int current = Integer.parseInt(String.valueOf(line.charAt(i)));
      if (current == i % 2) {
        firstIs1ColoringCount++;
      } else {
        firstIs0ColoringCount++;
      }
    }
    pw.println(Math.min(firstIs0ColoringCount, firstIs1ColoringCount));
  }
} Main
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    resolve(System.in, System.out);
  }

  static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    String line = sc.nextLine();
    int[] titles = new int[line.length()];
    int firstIs0ColoringCount = 0;
    int firstIs1ColoringCount = 0;
    for (int i = 0; i < line.length(); i++) {
      int current = Integer.parseInt(String.valueOf(line.charAt(i)));
      if (current == i % 2) {
        firstIs1ColoringCount++;
      } else {
        firstIs0ColoringCount++;
      }
    }
    pw.println(Math.min(firstIs0ColoringCount, firstIs1ColoringCount));
  }
}
