import java.util.Scanner;

public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			int N = S.length();
			
			StringBuffer sb = new StringBuffer(S);
			StringBuffer sc = new StringBuffer(S);
			sc.reverse();
			//String SR =sc.toString();
			int count = 0;
			int countR = 0;
			
			if(N==1) {
				System.out.println(0);
			}else {
				
			
			for(int i = 1;i<N;i++) {
				String su = sb.substring(i-1, i);
				String sm = sb.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sb.replace(i, i+1, "0");
					count++;
					//System.out.println(sb);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sb.replace(i, i+1, "1");
					count++;
					//System.out.println(sb);
				}
			}
			System.out.println();
				
			for(int i = 1;i<N;i++) {
				String su = sc.substring(i-1, i);
				String sm = sc.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sc.replace(i, i+1, "0");
					countR++;
					//System.out.println(sc);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sc.replace(i, i+1, "1");
					countR++;
					//System.out.println(sc);
				}
			}
			
			System.out.println(count>countR?countR:count);
			
			
			}
			
			
		}
		
		
	}
		

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			int N = S.length();
			
			StringBuffer sb = new StringBuffer(S);
			StringBuffer sc = new StringBuffer(S);
			sc.reverse();
			//String SR =sc.toString();
			int count = 0;
			int countR = 0;
			
			if(N==1) {
				System.out.println(0);
			}else {
				
			
			for(int i = 1;i<N;i++) {
				String su = sb.substring(i-1, i);
				String sm = sb.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sb.replace(i, i+1, "0");
					count++;
					//System.out.println(sb);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sb.replace(i, i+1, "1");
					count++;
					//System.out.println(sb);
				}
			}
			System.out.println();
				
			for(int i = 1;i<N;i++) {
				String su = sc.substring(i-1, i);
				String sm = sc.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sc.replace(i, i+1, "0");
					countR++;
					//System.out.println(sc);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sc.replace(i, i+1, "1");
					countR++;
					//System.out.println(sc);
				}
			}
			
			System.out.println(count>countR?countR:count);
			
			
			}
			
			
		}
		
		
	}
		

} Main public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			int N = S.length();
			
			StringBuffer sb = new StringBuffer(S);
			StringBuffer sc = new StringBuffer(S);
			sc.reverse();
			//String SR =sc.toString();
			int count = 0;
			int countR = 0;
			
			if(N==1) {
				System.out.println(0);
			}else {
				
			
			for(int i = 1;i<N;i++) {
				String su = sb.substring(i-1, i);
				String sm = sb.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sb.replace(i, i+1, "0");
					count++;
					//System.out.println(sb);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sb.replace(i, i+1, "1");
					count++;
					//System.out.println(sb);
				}
			}
			System.out.println();
				
			for(int i = 1;i<N;i++) {
				String su = sc.substring(i-1, i);
				String sm = sc.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sc.replace(i, i+1, "0");
					countR++;
					//System.out.println(sc);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sc.replace(i, i+1, "1");
					countR++;
					//System.out.println(sc);
				}
			}
			
			System.out.println(count>countR?countR:count);
			
			
			}
			
			
		}
		
		
	} main {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			int N = S.length();
			
			StringBuffer sb = new StringBuffer(S);
			StringBuffer sc = new StringBuffer(S);
			sc.reverse();
			//String SR =sc.toString();
			int count = 0;
			int countR = 0;
			
			if(N==1) {
				System.out.println(0);
			}else {
				
			
			for(int i = 1;i<N;i++) {
				String su = sb.substring(i-1, i);
				String sm = sb.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sb.replace(i, i+1, "0");
					count++;
					//System.out.println(sb);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sb.replace(i, i+1, "1");
					count++;
					//System.out.println(sb);
				}
			}
			System.out.println();
				
			for(int i = 1;i<N;i++) {
				String su = sc.substring(i-1, i);
				String sm = sc.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sc.replace(i, i+1, "0");
					countR++;
					//System.out.println(sc);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sc.replace(i, i+1, "1");
					countR++;
					//System.out.println(sc);
				}
			}
			
			System.out.println(count>countR?countR:count);
			
			
			}
			
			
		}
		
		
	} try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			int N = S.length();
			
			StringBuffer sb = new StringBuffer(S);
			StringBuffer sc = new StringBuffer(S);
			sc.reverse();
			//String SR =sc.toString();
			int count = 0;
			int countR = 0;
			
			if(N==1) {
				System.out.println(0);
			}else {
				
			
			for(int i = 1;i<N;i++) {
				String su = sb.substring(i-1, i);
				String sm = sb.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sb.replace(i, i+1, "0");
					count++;
					//System.out.println(sb);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sb.replace(i, i+1, "1");
					count++;
					//System.out.println(sb);
				}
			}
			System.out.println();
				
			for(int i = 1;i<N;i++) {
				String su = sc.substring(i-1, i);
				String sm = sc.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sc.replace(i, i+1, "0");
					countR++;
					//System.out.println(sc);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sc.replace(i, i+1, "1");
					countR++;
					//System.out.println(sc);
				}
			}
			
			System.out.println(count>countR?countR:count);
			
			
			}
			
			
		} {
			
			String S = scan.next();
			int N = S.length();
			
			StringBuffer sb = new StringBuffer(S);
			StringBuffer sc = new StringBuffer(S);
			sc.reverse();
			//String SR =sc.toString();
			int count = 0;
			int countR = 0;
			
			if(N==1) {
				System.out.println(0);
			}else {
				
			
			for(int i = 1;i<N;i++) {
				String su = sb.substring(i-1, i);
				String sm = sb.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sb.replace(i, i+1, "0");
					count++;
					//System.out.println(sb);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sb.replace(i, i+1, "1");
					count++;
					//System.out.println(sb);
				}
			}
			System.out.println();
				
			for(int i = 1;i<N;i++) {
				String su = sc.substring(i-1, i);
				String sm = sc.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sc.replace(i, i+1, "0");
					countR++;
					//System.out.println(sc);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sc.replace(i, i+1, "1");
					countR++;
					//System.out.println(sc);
				}
			}
			
			System.out.println(count>countR?countR:count);
			
			
			}
			
			
		} Scanner scan = new Scanner(System.in) Scanner scan = new Scanner(System.in) new Scanner(System.in) String S = scan.next(); S scan.next() scan.next scan int N = S.length(); N S.length() S.length S StringBuffer sb = new StringBuffer(S); sb new StringBuffer(S) StringBuffer sc = new StringBuffer(S); sc new StringBuffer(S) sc.reverse() sc.reverse sc int count = 0; count 0 int countR = 0; countR 0 if(N==1) {
				System.out.println(0);
			}else {
				
			
			for(int i = 1;i<N;i++) {
				String su = sb.substring(i-1, i);
				String sm = sb.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sb.replace(i, i+1, "0");
					count++;
					//System.out.println(sb);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sb.replace(i, i+1, "1");
					count++;
					//System.out.println(sb);
				}
			}
			System.out.println();
				
			for(int i = 1;i<N;i++) {
				String su = sc.substring(i-1, i);
				String sm = sc.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sc.replace(i, i+1, "0");
					countR++;
					//System.out.println(sc);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sc.replace(i, i+1, "1");
					countR++;
					//System.out.println(sc);
				}
			}
			
			System.out.println(count>countR?countR:count);
			
			
			} N==1 N 1 {
				System.out.println(0);
			} System.out.println(0) System.out.println System.out System System.out 0 {
				
			
			for(int i = 1;i<N;i++) {
				String su = sb.substring(i-1, i);
				String sm = sb.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sb.replace(i, i+1, "0");
					count++;
					//System.out.println(sb);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sb.replace(i, i+1, "1");
					count++;
					//System.out.println(sb);
				}
			}
			System.out.println();
				
			for(int i = 1;i<N;i++) {
				String su = sc.substring(i-1, i);
				String sm = sc.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sc.replace(i, i+1, "0");
					countR++;
					//System.out.println(sc);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sc.replace(i, i+1, "1");
					countR++;
					//System.out.println(sc);
				}
			}
			
			System.out.println(count>countR?countR:count);
			
			
			} for(int i = 1;i<N;i++) {
				String su = sb.substring(i-1, i);
				String sm = sb.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sb.replace(i, i+1, "0");
					count++;
					//System.out.println(sb);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sb.replace(i, i+1, "1");
					count++;
					//System.out.println(sb);
				}
			} int i = 1; int i = 1; i 1 i<N i N i++ i++ i {
				String su = sb.substring(i-1, i);
				String sm = sb.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sb.replace(i, i+1, "0");
					count++;
					//System.out.println(sb);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sb.replace(i, i+1, "1");
					count++;
					//System.out.println(sb);
				}
			} {
				String su = sb.substring(i-1, i);
				String sm = sb.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sb.replace(i, i+1, "0");
					count++;
					//System.out.println(sb);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sb.replace(i, i+1, "1");
					count++;
					//System.out.println(sb);
				}
			} String su = sb.substring(i-1, i); su sb.substring(i-1, i) sb.substring sb i-1 i 1 i String sm = sb.substring(i, i+1); sm sb.substring(i, i+1) sb.substring sb i i+1 i 1 if(sm.equals(su)&&sm.equals("1")) {
					sb.replace(i, i+1, "0");
					count++;
					//System.out.println(sb);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sb.replace(i, i+1, "1");
					count++;
					//System.out.println(sb);
				} sm.equals(su)&&sm.equals("1") sm.equals(su) sm.equals sm su sm.equals("1") sm.equals sm "1" {
					sb.replace(i, i+1, "0");
					count++;
					//System.out.println(sb);
				} sb.replace(i, i+1, "0") sb.replace sb i i+1 i 1 "0" count++ count if(sm.equals(su)&&sm.equals("0")) {
					sb.replace(i, i+1, "1");
					count++;
					//System.out.println(sb);
				} sm.equals(su)&&sm.equals("0") sm.equals(su) sm.equals sm su sm.equals("0") sm.equals sm "0" {
					sb.replace(i, i+1, "1");
					count++;
					//System.out.println(sb);
				} sb.replace(i, i+1, "1") sb.replace sb i i+1 i 1 "1" count++ count System.out.println() System.out.println System.out System System.out for(int i = 1;i<N;i++) {
				String su = sc.substring(i-1, i);
				String sm = sc.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sc.replace(i, i+1, "0");
					countR++;
					//System.out.println(sc);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sc.replace(i, i+1, "1");
					countR++;
					//System.out.println(sc);
				}
			} int i = 1; int i = 1; i 1 i<N i N i++ i++ i {
				String su = sc.substring(i-1, i);
				String sm = sc.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sc.replace(i, i+1, "0");
					countR++;
					//System.out.println(sc);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sc.replace(i, i+1, "1");
					countR++;
					//System.out.println(sc);
				}
			} {
				String su = sc.substring(i-1, i);
				String sm = sc.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sc.replace(i, i+1, "0");
					countR++;
					//System.out.println(sc);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sc.replace(i, i+1, "1");
					countR++;
					//System.out.println(sc);
				}
			} String su = sc.substring(i-1, i); su sc.substring(i-1, i) sc.substring sc i-1 i 1 i String sm = sc.substring(i, i+1); sm sc.substring(i, i+1) sc.substring sc i i+1 i 1 if(sm.equals(su)&&sm.equals("1")) {
					sc.replace(i, i+1, "0");
					countR++;
					//System.out.println(sc);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sc.replace(i, i+1, "1");
					countR++;
					//System.out.println(sc);
				} sm.equals(su)&&sm.equals("1") sm.equals(su) sm.equals sm su sm.equals("1") sm.equals sm "1" {
					sc.replace(i, i+1, "0");
					countR++;
					//System.out.println(sc);
				} sc.replace(i, i+1, "0") sc.replace sc i i+1 i 1 "0" countR++ countR if(sm.equals(su)&&sm.equals("0")) {
					sc.replace(i, i+1, "1");
					countR++;
					//System.out.println(sc);
				} sm.equals(su)&&sm.equals("0") sm.equals(su) sm.equals sm su sm.equals("0") sm.equals sm "0" {
					sc.replace(i, i+1, "1");
					countR++;
					//System.out.println(sc);
				} sc.replace(i, i+1, "1") sc.replace sc i i+1 i 1 "1" countR++ countR System.out.println(count>countR?countR:count) System.out.println System.out System System.out count>countR?countR:count count>countR count countR countR count String[]args args public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			int N = S.length();
			
			StringBuffer sb = new StringBuffer(S);
			StringBuffer sc = new StringBuffer(S);
			sc.reverse();
			//String SR =sc.toString();
			int count = 0;
			int countR = 0;
			
			if(N==1) {
				System.out.println(0);
			}else {
				
			
			for(int i = 1;i<N;i++) {
				String su = sb.substring(i-1, i);
				String sm = sb.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sb.replace(i, i+1, "0");
					count++;
					//System.out.println(sb);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sb.replace(i, i+1, "1");
					count++;
					//System.out.println(sb);
				}
			}
			System.out.println();
				
			for(int i = 1;i<N;i++) {
				String su = sc.substring(i-1, i);
				String sm = sc.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sc.replace(i, i+1, "0");
					countR++;
					//System.out.println(sc);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sc.replace(i, i+1, "1");
					countR++;
					//System.out.println(sc);
				}
			}
			
			System.out.println(count>countR?countR:count);
			
			
			}
			
			
		}
		
		
	}
		

} public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			int N = S.length();
			
			StringBuffer sb = new StringBuffer(S);
			StringBuffer sc = new StringBuffer(S);
			sc.reverse();
			//String SR =sc.toString();
			int count = 0;
			int countR = 0;
			
			if(N==1) {
				System.out.println(0);
			}else {
				
			
			for(int i = 1;i<N;i++) {
				String su = sb.substring(i-1, i);
				String sm = sb.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sb.replace(i, i+1, "0");
					count++;
					//System.out.println(sb);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sb.replace(i, i+1, "1");
					count++;
					//System.out.println(sb);
				}
			}
			System.out.println();
				
			for(int i = 1;i<N;i++) {
				String su = sc.substring(i-1, i);
				String sm = sc.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sc.replace(i, i+1, "0");
					countR++;
					//System.out.println(sc);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sc.replace(i, i+1, "1");
					countR++;
					//System.out.println(sc);
				}
			}
			
			System.out.println(count>countR?countR:count);
			
			
			}
			
			
		}
		
		
	}
		

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			String S = scan.next();
			int N = S.length();
			
			StringBuffer sb = new StringBuffer(S);
			StringBuffer sc = new StringBuffer(S);
			sc.reverse();
			//String SR =sc.toString();
			int count = 0;
			int countR = 0;
			
			if(N==1) {
				System.out.println(0);
			}else {
				
			
			for(int i = 1;i<N;i++) {
				String su = sb.substring(i-1, i);
				String sm = sb.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sb.replace(i, i+1, "0");
					count++;
					//System.out.println(sb);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sb.replace(i, i+1, "1");
					count++;
					//System.out.println(sb);
				}
			}
			System.out.println();
				
			for(int i = 1;i<N;i++) {
				String su = sc.substring(i-1, i);
				String sm = sc.substring(i, i+1);
				if(sm.equals(su)&&sm.equals("1")) {
					sc.replace(i, i+1, "0");
					countR++;
					//System.out.println(sc);
				}else if(sm.equals(su)&&sm.equals("0")) {
					sc.replace(i, i+1, "1");
					countR++;
					//System.out.println(sc);
				}
			}
			
			System.out.println(count>countR?countR:count);
			
			
			}
			
			
		}
		
		
	}
		

}
