import java.util.*;
public class Main { 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] chs = str.toCharArray();
        int evenCnt = 0; // even digit is 0
        int oddCnt = 0; // odd digit is 0

        for(int i = 0; i < chs.length; i++) {
          if(i % 2 == 0) {// even digit
            if(chs[i] == '1')
              evenCnt++;
            else
              oddCnt++;
          } else { // odd digit
            if(chs[i] == '0')
              evenCnt++;
            else
              oddCnt++;
          }
        }
        System.out.println(Math.min(evenCnt, oddCnt));
    }
} import java.util.*; util.* java public class Main { 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] chs = str.toCharArray();
        int evenCnt = 0; // even digit is 0
        int oddCnt = 0; // odd digit is 0

        for(int i = 0; i < chs.length; i++) {
          if(i % 2 == 0) {// even digit
            if(chs[i] == '1')
              evenCnt++;
            else
              oddCnt++;
          } else { // odd digit
            if(chs[i] == '0')
              evenCnt++;
            else
              oddCnt++;
          }
        }
        System.out.println(Math.min(evenCnt, oddCnt));
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] chs = str.toCharArray();
        int evenCnt = 0; // even digit is 0
        int oddCnt = 0; // odd digit is 0

        for(int i = 0; i < chs.length; i++) {
          if(i % 2 == 0) {// even digit
            if(chs[i] == '1')
              evenCnt++;
            else
              oddCnt++;
          } else { // odd digit
            if(chs[i] == '0')
              evenCnt++;
            else
              oddCnt++;
          }
        }
        System.out.println(Math.min(evenCnt, oddCnt));
    } main {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] chs = str.toCharArray();
        int evenCnt = 0; // even digit is 0
        int oddCnt = 0; // odd digit is 0

        for(int i = 0; i < chs.length; i++) {
          if(i % 2 == 0) {// even digit
            if(chs[i] == '1')
              evenCnt++;
            else
              oddCnt++;
          } else { // odd digit
            if(chs[i] == '0')
              evenCnt++;
            else
              oddCnt++;
          }
        }
        System.out.println(Math.min(evenCnt, oddCnt));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.next(); str sc.next() sc.next sc char[] chs = str.toCharArray(); chs str.toCharArray() str.toCharArray str int evenCnt = 0; evenCnt 0 int oddCnt = 0; oddCnt 0 for(int i = 0; i < chs.length; i++) {
          if(i % 2 == 0) {// even digit
            if(chs[i] == '1')
              evenCnt++;
            else
              oddCnt++;
          } else { // odd digit
            if(chs[i] == '0')
              evenCnt++;
            else
              oddCnt++;
          }
        } int i = 0; int i = 0; i 0 i < chs.length i chs.length chs chs.length i++ i++ i {
          if(i % 2 == 0) {// even digit
            if(chs[i] == '1')
              evenCnt++;
            else
              oddCnt++;
          } else { // odd digit
            if(chs[i] == '0')
              evenCnt++;
            else
              oddCnt++;
          }
        } {
          if(i % 2 == 0) {// even digit
            if(chs[i] == '1')
              evenCnt++;
            else
              oddCnt++;
          } else { // odd digit
            if(chs[i] == '0')
              evenCnt++;
            else
              oddCnt++;
          }
        } if(i % 2 == 0) {// even digit
            if(chs[i] == '1')
              evenCnt++;
            else
              oddCnt++;
          } else { // odd digit
            if(chs[i] == '0')
              evenCnt++;
            else
              oddCnt++;
          } i % 2 == 0 i % 2 i 2 0 {// even digit
            if(chs[i] == '1')
              evenCnt++;
            else
              oddCnt++;
          } if(chs[i] == '1')
              evenCnt++;
            else
              oddCnt++; chs[i] == '1' chs[i] chs i '1' evenCnt++ evenCnt oddCnt++ oddCnt { // odd digit
            if(chs[i] == '0')
              evenCnt++;
            else
              oddCnt++;
          } if(chs[i] == '0')
              evenCnt++;
            else
              oddCnt++; chs[i] == '0' chs[i] chs i '0' evenCnt++ evenCnt oddCnt++ oddCnt System.out.println(Math.min(evenCnt, oddCnt)) System.out.println System.out System System.out Math.min(evenCnt, oddCnt) Math.min Math evenCnt oddCnt String[] args args public class Main { 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] chs = str.toCharArray();
        int evenCnt = 0; // even digit is 0
        int oddCnt = 0; // odd digit is 0

        for(int i = 0; i < chs.length; i++) {
          if(i % 2 == 0) {// even digit
            if(chs[i] == '1')
              evenCnt++;
            else
              oddCnt++;
          } else { // odd digit
            if(chs[i] == '0')
              evenCnt++;
            else
              oddCnt++;
          }
        }
        System.out.println(Math.min(evenCnt, oddCnt));
    }
} public class Main { 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] chs = str.toCharArray();
        int evenCnt = 0; // even digit is 0
        int oddCnt = 0; // odd digit is 0

        for(int i = 0; i < chs.length; i++) {
          if(i % 2 == 0) {// even digit
            if(chs[i] == '1')
              evenCnt++;
            else
              oddCnt++;
          } else { // odd digit
            if(chs[i] == '0')
              evenCnt++;
            else
              oddCnt++;
          }
        }
        System.out.println(Math.min(evenCnt, oddCnt));
    }
} Main
import java.util.*;
public class Main { 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] chs = str.toCharArray();
        int evenCnt = 0; // even digit is 0
        int oddCnt = 0; // odd digit is 0

        for(int i = 0; i < chs.length; i++) {
          if(i % 2 == 0) {// even digit
            if(chs[i] == '1')
              evenCnt++;
            else
              oddCnt++;
          } else { // odd digit
            if(chs[i] == '0')
              evenCnt++;
            else
              oddCnt++;
          }
        }
        System.out.println(Math.min(evenCnt, oddCnt));
    }
}