import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String[] c = s.split("");
        int countA = 0;
        int countB = 0;
        for (int i = 0; i < s.length(); i += 2) {
            if (c[i].equals("0"))
                countA++;
        }
        for (int i = 1; i < s.length(); i += 2) {
            if (c[i].equals("1"))
                countA++;
        }
        for (int i = 0; i < s.length(); i += 2) {
            if (c[i].equals("1"))
                countB++;
        }
        for (int i = 1; i < s.length(); i += 2) {
            if (c[i].equals("0"))
                countB++;
        }
        System.out.println(Math.min(countA, countB));
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String[] c = s.split("");
        int countA = 0;
        int countB = 0;
        for (int i = 0; i < s.length(); i += 2) {
            if (c[i].equals("0"))
                countA++;
        }
        for (int i = 1; i < s.length(); i += 2) {
            if (c[i].equals("1"))
                countA++;
        }
        for (int i = 0; i < s.length(); i += 2) {
            if (c[i].equals("1"))
                countB++;
        }
        for (int i = 1; i < s.length(); i += 2) {
            if (c[i].equals("0"))
                countB++;
        }
        System.out.println(Math.min(countA, countB));
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String[] c = s.split("");
        int countA = 0;
        int countB = 0;
        for (int i = 0; i < s.length(); i += 2) {
            if (c[i].equals("0"))
                countA++;
        }
        for (int i = 1; i < s.length(); i += 2) {
            if (c[i].equals("1"))
                countA++;
        }
        for (int i = 0; i < s.length(); i += 2) {
            if (c[i].equals("1"))
                countB++;
        }
        for (int i = 1; i < s.length(); i += 2) {
            if (c[i].equals("0"))
                countB++;
        }
        System.out.println(Math.min(countA, countB));
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String[] c = s.split("");
        int countA = 0;
        int countB = 0;
        for (int i = 0; i < s.length(); i += 2) {
            if (c[i].equals("0"))
                countA++;
        }
        for (int i = 1; i < s.length(); i += 2) {
            if (c[i].equals("1"))
                countA++;
        }
        for (int i = 0; i < s.length(); i += 2) {
            if (c[i].equals("1"))
                countB++;
        }
        for (int i = 1; i < s.length(); i += 2) {
            if (c[i].equals("0"))
                countB++;
        }
        System.out.println(Math.min(countA, countB));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc String[] c = s.split(""); c s.split("") s.split s "" int countA = 0; countA 0 int countB = 0; countB 0 for (int i = 0; i < s.length(); i += 2) {
            if (c[i].equals("0"))
                countA++;
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i += 2 i += 2 i 2 {
            if (c[i].equals("0"))
                countA++;
        } {
            if (c[i].equals("0"))
                countA++;
        } if (c[i].equals("0"))
                countA++; c[i].equals("0") c[i].equals c[i] c i "0" countA++ countA for (int i = 1; i < s.length(); i += 2) {
            if (c[i].equals("1"))
                countA++;
        } int i = 1; int i = 1; i 1 i < s.length() i s.length() s.length s i += 2 i += 2 i 2 {
            if (c[i].equals("1"))
                countA++;
        } {
            if (c[i].equals("1"))
                countA++;
        } if (c[i].equals("1"))
                countA++; c[i].equals("1") c[i].equals c[i] c i "1" countA++ countA for (int i = 0; i < s.length(); i += 2) {
            if (c[i].equals("1"))
                countB++;
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i += 2 i += 2 i 2 {
            if (c[i].equals("1"))
                countB++;
        } {
            if (c[i].equals("1"))
                countB++;
        } if (c[i].equals("1"))
                countB++; c[i].equals("1") c[i].equals c[i] c i "1" countB++ countB for (int i = 1; i < s.length(); i += 2) {
            if (c[i].equals("0"))
                countB++;
        } int i = 1; int i = 1; i 1 i < s.length() i s.length() s.length s i += 2 i += 2 i 2 {
            if (c[i].equals("0"))
                countB++;
        } {
            if (c[i].equals("0"))
                countB++;
        } if (c[i].equals("0"))
                countB++; c[i].equals("0") c[i].equals c[i] c i "0" countB++ countB System.out.println(Math.min(countA, countB)) System.out.println System.out System System.out Math.min(countA, countB) Math.min Math countA countB String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String[] c = s.split("");
        int countA = 0;
        int countB = 0;
        for (int i = 0; i < s.length(); i += 2) {
            if (c[i].equals("0"))
                countA++;
        }
        for (int i = 1; i < s.length(); i += 2) {
            if (c[i].equals("1"))
                countA++;
        }
        for (int i = 0; i < s.length(); i += 2) {
            if (c[i].equals("1"))
                countB++;
        }
        for (int i = 1; i < s.length(); i += 2) {
            if (c[i].equals("0"))
                countB++;
        }
        System.out.println(Math.min(countA, countB));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String[] c = s.split("");
        int countA = 0;
        int countB = 0;
        for (int i = 0; i < s.length(); i += 2) {
            if (c[i].equals("0"))
                countA++;
        }
        for (int i = 1; i < s.length(); i += 2) {
            if (c[i].equals("1"))
                countA++;
        }
        for (int i = 0; i < s.length(); i += 2) {
            if (c[i].equals("1"))
                countB++;
        }
        for (int i = 1; i < s.length(); i += 2) {
            if (c[i].equals("0"))
                countB++;
        }
        System.out.println(Math.min(countA, countB));
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String[] c = s.split("");
        int countA = 0;
        int countB = 0;
        for (int i = 0; i < s.length(); i += 2) {
            if (c[i].equals("0"))
                countA++;
        }
        for (int i = 1; i < s.length(); i += 2) {
            if (c[i].equals("1"))
                countA++;
        }
        for (int i = 0; i < s.length(); i += 2) {
            if (c[i].equals("1"))
                countB++;
        }
        for (int i = 1; i < s.length(); i += 2) {
            if (c[i].equals("0"))
                countB++;
        }
        System.out.println(Math.min(countA, countB));
    }
}
