import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String N = sc.next();
        String[] tile = N.split("");
        
        String[] a = new String[tile.length];
        String[] b = new String[tile.length];
        
        int cnt1 = 0;
        int cnt2 = 0;
        

        for(int i = 0;i<tile.length;i++) {
        	if(i%2 == 0) {
        		if(tile[i].equals("1")) {
        			cnt1++;
        		}
        	}else {
        		if(tile[i].equals("0")) {
        			cnt1++;
        		}
        	}
        }
        
        for(int i = 0;i<tile.length;i++) {
        	if(i%2 == 0) {
        		if(tile[i].equals("0")) {
        			cnt2++;
        		}
        	}else {
        		if(tile[i].equals("1")) {
        			cnt2++;
        		}
        	}
        }
        System.out.println(Math.min(cnt1, cnt2));
       
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String N = sc.next();
        String[] tile = N.split("");
        
        String[] a = new String[tile.length];
        String[] b = new String[tile.length];
        
        int cnt1 = 0;
        int cnt2 = 0;
        

        for(int i = 0;i<tile.length;i++) {
        	if(i%2 == 0) {
        		if(tile[i].equals("1")) {
        			cnt1++;
        		}
        	}else {
        		if(tile[i].equals("0")) {
        			cnt1++;
        		}
        	}
        }
        
        for(int i = 0;i<tile.length;i++) {
        	if(i%2 == 0) {
        		if(tile[i].equals("0")) {
        			cnt2++;
        		}
        	}else {
        		if(tile[i].equals("1")) {
        			cnt2++;
        		}
        	}
        }
        System.out.println(Math.min(cnt1, cnt2));
       
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String N = sc.next();
        String[] tile = N.split("");
        
        String[] a = new String[tile.length];
        String[] b = new String[tile.length];
        
        int cnt1 = 0;
        int cnt2 = 0;
        

        for(int i = 0;i<tile.length;i++) {
        	if(i%2 == 0) {
        		if(tile[i].equals("1")) {
        			cnt1++;
        		}
        	}else {
        		if(tile[i].equals("0")) {
        			cnt1++;
        		}
        	}
        }
        
        for(int i = 0;i<tile.length;i++) {
        	if(i%2 == 0) {
        		if(tile[i].equals("0")) {
        			cnt2++;
        		}
        	}else {
        		if(tile[i].equals("1")) {
        			cnt2++;
        		}
        	}
        }
        System.out.println(Math.min(cnt1, cnt2));
       
    } main {
        Scanner sc = new Scanner(System.in);
        String N = sc.next();
        String[] tile = N.split("");
        
        String[] a = new String[tile.length];
        String[] b = new String[tile.length];
        
        int cnt1 = 0;
        int cnt2 = 0;
        

        for(int i = 0;i<tile.length;i++) {
        	if(i%2 == 0) {
        		if(tile[i].equals("1")) {
        			cnt1++;
        		}
        	}else {
        		if(tile[i].equals("0")) {
        			cnt1++;
        		}
        	}
        }
        
        for(int i = 0;i<tile.length;i++) {
        	if(i%2 == 0) {
        		if(tile[i].equals("0")) {
        			cnt2++;
        		}
        	}else {
        		if(tile[i].equals("1")) {
        			cnt2++;
        		}
        	}
        }
        System.out.println(Math.min(cnt1, cnt2));
       
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String N = sc.next(); N sc.next() sc.next sc String[] tile = N.split(""); tile N.split("") N.split N "" String[] a = new String[tile.length]; a new String[tile.length] tile.length tile tile.length String[] b = new String[tile.length]; b new String[tile.length] tile.length tile tile.length int cnt1 = 0; cnt1 0 int cnt2 = 0; cnt2 0 for(int i = 0;i<tile.length;i++) {
        	if(i%2 == 0) {
        		if(tile[i].equals("1")) {
        			cnt1++;
        		}
        	}else {
        		if(tile[i].equals("0")) {
        			cnt1++;
        		}
        	}
        } int i = 0; int i = 0; i 0 i<tile.length i tile.length tile tile.length i++ i++ i {
        	if(i%2 == 0) {
        		if(tile[i].equals("1")) {
        			cnt1++;
        		}
        	}else {
        		if(tile[i].equals("0")) {
        			cnt1++;
        		}
        	}
        } {
        	if(i%2 == 0) {
        		if(tile[i].equals("1")) {
        			cnt1++;
        		}
        	}else {
        		if(tile[i].equals("0")) {
        			cnt1++;
        		}
        	}
        } if(i%2 == 0) {
        		if(tile[i].equals("1")) {
        			cnt1++;
        		}
        	}else {
        		if(tile[i].equals("0")) {
        			cnt1++;
        		}
        	} i%2 == 0 i%2 i 2 0 {
        		if(tile[i].equals("1")) {
        			cnt1++;
        		}
        	} if(tile[i].equals("1")) {
        			cnt1++;
        		} tile[i].equals("1") tile[i].equals tile[i] tile i "1" {
        			cnt1++;
        		} cnt1++ cnt1 {
        		if(tile[i].equals("0")) {
        			cnt1++;
        		}
        	} if(tile[i].equals("0")) {
        			cnt1++;
        		} tile[i].equals("0") tile[i].equals tile[i] tile i "0" {
        			cnt1++;
        		} cnt1++ cnt1 for(int i = 0;i<tile.length;i++) {
        	if(i%2 == 0) {
        		if(tile[i].equals("0")) {
        			cnt2++;
        		}
        	}else {
        		if(tile[i].equals("1")) {
        			cnt2++;
        		}
        	}
        } int i = 0; int i = 0; i 0 i<tile.length i tile.length tile tile.length i++ i++ i {
        	if(i%2 == 0) {
        		if(tile[i].equals("0")) {
        			cnt2++;
        		}
        	}else {
        		if(tile[i].equals("1")) {
        			cnt2++;
        		}
        	}
        } {
        	if(i%2 == 0) {
        		if(tile[i].equals("0")) {
        			cnt2++;
        		}
        	}else {
        		if(tile[i].equals("1")) {
        			cnt2++;
        		}
        	}
        } if(i%2 == 0) {
        		if(tile[i].equals("0")) {
        			cnt2++;
        		}
        	}else {
        		if(tile[i].equals("1")) {
        			cnt2++;
        		}
        	} i%2 == 0 i%2 i 2 0 {
        		if(tile[i].equals("0")) {
        			cnt2++;
        		}
        	} if(tile[i].equals("0")) {
        			cnt2++;
        		} tile[i].equals("0") tile[i].equals tile[i] tile i "0" {
        			cnt2++;
        		} cnt2++ cnt2 {
        		if(tile[i].equals("1")) {
        			cnt2++;
        		}
        	} if(tile[i].equals("1")) {
        			cnt2++;
        		} tile[i].equals("1") tile[i].equals tile[i] tile i "1" {
        			cnt2++;
        		} cnt2++ cnt2 System.out.println(Math.min(cnt1, cnt2)) System.out.println System.out System System.out Math.min(cnt1, cnt2) Math.min Math cnt1 cnt2 String[] args args
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String N = sc.next();
        String[] tile = N.split("");
        
        String[] a = new String[tile.length];
        String[] b = new String[tile.length];
        
        int cnt1 = 0;
        int cnt2 = 0;
        

        for(int i = 0;i<tile.length;i++) {
        	if(i%2 == 0) {
        		if(tile[i].equals("1")) {
        			cnt1++;
        		}
        	}else {
        		if(tile[i].equals("0")) {
        			cnt1++;
        		}
        	}
        }
        
        for(int i = 0;i<tile.length;i++) {
        	if(i%2 == 0) {
        		if(tile[i].equals("0")) {
        			cnt2++;
        		}
        	}else {
        		if(tile[i].equals("1")) {
        			cnt2++;
        		}
        	}
        }
        System.out.println(Math.min(cnt1, cnt2));
       
    }
}