import java.util.Scanner;

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

    char[] s = scanner.next().toCharArray();
    int min = s.length;
    for (int i = 0; i < 2; i++) {
      int cnt = 0;
      for (int j = 0; j < s.length; j++) {
        if (s[j] - '0' + Math.abs(i - j % 2) == 1) cnt++;
      }
      min = Math.min(min, cnt);
    }
    System.out.println(min);
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    char[] s = scanner.next().toCharArray();
    int min = s.length;
    for (int i = 0; i < 2; i++) {
      int cnt = 0;
      for (int j = 0; j < s.length; j++) {
        if (s[j] - '0' + Math.abs(i - j % 2) == 1) cnt++;
      }
      min = Math.min(min, cnt);
    }
    System.out.println(min);
  }
} Main public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    char[] s = scanner.next().toCharArray();
    int min = s.length;
    for (int i = 0; i < 2; i++) {
      int cnt = 0;
      for (int j = 0; j < s.length; j++) {
        if (s[j] - '0' + Math.abs(i - j % 2) == 1) cnt++;
      }
      min = Math.min(min, cnt);
    }
    System.out.println(min);
  } main {
    Scanner scanner = new Scanner(System.in);

    char[] s = scanner.next().toCharArray();
    int min = s.length;
    for (int i = 0; i < 2; i++) {
      int cnt = 0;
      for (int j = 0; j < s.length; j++) {
        if (s[j] - '0' + Math.abs(i - j % 2) == 1) cnt++;
      }
      min = Math.min(min, cnt);
    }
    System.out.println(min);
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) char[] s = scanner.next().toCharArray(); s scanner.next().toCharArray() scanner.next().toCharArray scanner.next() scanner.next scanner int min = s.length; min s.length s s.length for (int i = 0; i < 2; i++) {
      int cnt = 0;
      for (int j = 0; j < s.length; j++) {
        if (s[j] - '0' + Math.abs(i - j % 2) == 1) cnt++;
      }
      min = Math.min(min, cnt);
    } int i = 0; int i = 0; i 0 i < 2 i 2 i++ i++ i {
      int cnt = 0;
      for (int j = 0; j < s.length; j++) {
        if (s[j] - '0' + Math.abs(i - j % 2) == 1) cnt++;
      }
      min = Math.min(min, cnt);
    } {
      int cnt = 0;
      for (int j = 0; j < s.length; j++) {
        if (s[j] - '0' + Math.abs(i - j % 2) == 1) cnt++;
      }
      min = Math.min(min, cnt);
    } int cnt = 0; cnt 0 for (int j = 0; j < s.length; j++) {
        if (s[j] - '0' + Math.abs(i - j % 2) == 1) cnt++;
      } int j = 0; int j = 0; j 0 j < s.length j s.length s s.length j++ j++ j {
        if (s[j] - '0' + Math.abs(i - j % 2) == 1) cnt++;
      } {
        if (s[j] - '0' + Math.abs(i - j % 2) == 1) cnt++;
      } if (s[j] - '0' + Math.abs(i - j % 2) == 1) cnt++; s[j] - '0' + Math.abs(i - j % 2) == 1 s[j] - '0' + Math.abs(i - j % 2) s[j] - '0' s[j] s j '0' Math.abs(i - j % 2) Math.abs Math i - j % 2 i j % 2 j 2 1 cnt++ cnt min = Math.min(min, cnt) min Math.min(min, cnt) Math.min Math min cnt System.out.println(min) System.out.println System.out System System.out min String[] args args public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    char[] s = scanner.next().toCharArray();
    int min = s.length;
    for (int i = 0; i < 2; i++) {
      int cnt = 0;
      for (int j = 0; j < s.length; j++) {
        if (s[j] - '0' + Math.abs(i - j % 2) == 1) cnt++;
      }
      min = Math.min(min, cnt);
    }
    System.out.println(min);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    char[] s = scanner.next().toCharArray();
    int min = s.length;
    for (int i = 0; i < 2; i++) {
      int cnt = 0;
      for (int j = 0; j < s.length; j++) {
        if (s[j] - '0' + Math.abs(i - j % 2) == 1) cnt++;
      }
      min = Math.min(min, cnt);
    }
    System.out.println(min);
  }
} Main
import java.util.Scanner;

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

    char[] s = scanner.next().toCharArray();
    int min = s.length;
    for (int i = 0; i < 2; i++) {
      int cnt = 0;
      for (int j = 0; j < s.length; j++) {
        if (s[j] - '0' + Math.abs(i - j % 2) == 1) cnt++;
      }
      min = Math.min(min, cnt);
    }
    System.out.println(min);
  }
}
