import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int[] A = new int[s.length()];
        for (int i = 0; i < A.length; i++) A[i] = s.charAt(i)-'0';
        System.out.println(helper(A));
        sc.close();
    }

    public static int helper(int[] A) {
        int res = 0, count = 0;
        for (int i = 0; i < A.length; i++) {
            if (i % 2 == 0) {
                if (A[i] != 0) res++;
                if (A[i] != 1) count++;
            } else {
                if (A[i] != 1) res++;
                if (A[i] != 0) count++;
            }
        }
        return Math.min(res, count);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int[] A = new int[s.length()];
        for (int i = 0; i < A.length; i++) A[i] = s.charAt(i)-'0';
        System.out.println(helper(A));
        sc.close();
    }

    public static int helper(int[] A) {
        int res = 0, count = 0;
        for (int i = 0; i < A.length; i++) {
            if (i % 2 == 0) {
                if (A[i] != 0) res++;
                if (A[i] != 1) count++;
            } else {
                if (A[i] != 1) res++;
                if (A[i] != 0) count++;
            }
        }
        return Math.min(res, count);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int[] A = new int[s.length()];
        for (int i = 0; i < A.length; i++) A[i] = s.charAt(i)-'0';
        System.out.println(helper(A));
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int[] A = new int[s.length()];
        for (int i = 0; i < A.length; i++) A[i] = s.charAt(i)-'0';
        System.out.println(helper(A));
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int[] A = new int[s.length()]; A new int[s.length()] s.length() s.length s for (int i = 0; i < A.length; i++) A[i] = s.charAt(i)-'0'; int i = 0; int i = 0; i 0 i < A.length i A.length A A.length i++ i++ i A[i] = s.charAt(i)-'0'; A[i] = s.charAt(i)-'0' A[i] A i s.charAt(i)-'0' s.charAt(i) s.charAt s i '0' System.out.println(helper(A)) System.out.println System.out System System.out helper(A) helper A sc.close() sc.close sc String[] args args public static int helper(int[] A) {
        int res = 0, count = 0;
        for (int i = 0; i < A.length; i++) {
            if (i % 2 == 0) {
                if (A[i] != 0) res++;
                if (A[i] != 1) count++;
            } else {
                if (A[i] != 1) res++;
                if (A[i] != 0) count++;
            }
        }
        return Math.min(res, count);
    } helper {
        int res = 0, count = 0;
        for (int i = 0; i < A.length; i++) {
            if (i % 2 == 0) {
                if (A[i] != 0) res++;
                if (A[i] != 1) count++;
            } else {
                if (A[i] != 1) res++;
                if (A[i] != 0) count++;
            }
        }
        return Math.min(res, count);
    } int res = 0 res 0 count = 0; count 0 for (int i = 0; i < A.length; i++) {
            if (i % 2 == 0) {
                if (A[i] != 0) res++;
                if (A[i] != 1) count++;
            } else {
                if (A[i] != 1) res++;
                if (A[i] != 0) count++;
            }
        } int i = 0; int i = 0; i 0 i < A.length i A.length A A.length i++ i++ i {
            if (i % 2 == 0) {
                if (A[i] != 0) res++;
                if (A[i] != 1) count++;
            } else {
                if (A[i] != 1) res++;
                if (A[i] != 0) count++;
            }
        } {
            if (i % 2 == 0) {
                if (A[i] != 0) res++;
                if (A[i] != 1) count++;
            } else {
                if (A[i] != 1) res++;
                if (A[i] != 0) count++;
            }
        } if (i % 2 == 0) {
                if (A[i] != 0) res++;
                if (A[i] != 1) count++;
            } else {
                if (A[i] != 1) res++;
                if (A[i] != 0) count++;
            } i % 2 == 0 i % 2 i 2 0 {
                if (A[i] != 0) res++;
                if (A[i] != 1) count++;
            } if (A[i] != 0) res++; A[i] != 0 A[i] A i 0 res++ res if (A[i] != 1) count++; A[i] != 1 A[i] A i 1 count++ count {
                if (A[i] != 1) res++;
                if (A[i] != 0) count++;
            } if (A[i] != 1) res++; A[i] != 1 A[i] A i 1 res++ res if (A[i] != 0) count++; A[i] != 0 A[i] A i 0 count++ count return Math.min(res, count); Math.min(res, count) Math.min Math res count int[] A A public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int[] A = new int[s.length()];
        for (int i = 0; i < A.length; i++) A[i] = s.charAt(i)-'0';
        System.out.println(helper(A));
        sc.close();
    }

    public static int helper(int[] A) {
        int res = 0, count = 0;
        for (int i = 0; i < A.length; i++) {
            if (i % 2 == 0) {
                if (A[i] != 0) res++;
                if (A[i] != 1) count++;
            } else {
                if (A[i] != 1) res++;
                if (A[i] != 0) count++;
            }
        }
        return Math.min(res, count);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int[] A = new int[s.length()];
        for (int i = 0; i < A.length; i++) A[i] = s.charAt(i)-'0';
        System.out.println(helper(A));
        sc.close();
    }

    public static int helper(int[] A) {
        int res = 0, count = 0;
        for (int i = 0; i < A.length; i++) {
            if (i % 2 == 0) {
                if (A[i] != 0) res++;
                if (A[i] != 1) count++;
            } else {
                if (A[i] != 1) res++;
                if (A[i] != 0) count++;
            }
        }
        return Math.min(res, count);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int[] A = new int[s.length()];
        for (int i = 0; i < A.length; i++) A[i] = s.charAt(i)-'0';
        System.out.println(helper(A));
        sc.close();
    }

    public static int helper(int[] A) {
        int res = 0, count = 0;
        for (int i = 0; i < A.length; i++) {
            if (i % 2 == 0) {
                if (A[i] != 0) res++;
                if (A[i] != 1) count++;
            } else {
                if (A[i] != 1) res++;
                if (A[i] != 0) count++;
            }
        }
        return Math.min(res, count);
    }
}