import java.util.Scanner;


public class Main {


	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int res = 0;
		String str = sc.next();
		int[] N = new int[str.length()];

		for(int i = 0;i<str.length();i++) {
			N[i]=str.charAt(i)-'0';
			//System.out.println(N[i]);
		}
		for(int n = 0;n<str.length()-1;n++) {
			if(N[n]==N[n+1]&&N[n+1]==0) {
				N[n+1]=1;
				res++;
			}else if(N[n]==N[n+1]&&N[n+1]==1) {
				N[n+1]=0;
				res++;
			}
		}

		System.out.println(res);
	}
} import java.util.Scanner; Scanner java.util public class Main {


	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int res = 0;
		String str = sc.next();
		int[] N = new int[str.length()];

		for(int i = 0;i<str.length();i++) {
			N[i]=str.charAt(i)-'0';
			//System.out.println(N[i]);
		}
		for(int n = 0;n<str.length()-1;n++) {
			if(N[n]==N[n+1]&&N[n+1]==0) {
				N[n+1]=1;
				res++;
			}else if(N[n]==N[n+1]&&N[n+1]==1) {
				N[n+1]=0;
				res++;
			}
		}

		System.out.println(res);
	}
} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int res = 0;
		String str = sc.next();
		int[] N = new int[str.length()];

		for(int i = 0;i<str.length();i++) {
			N[i]=str.charAt(i)-'0';
			//System.out.println(N[i]);
		}
		for(int n = 0;n<str.length()-1;n++) {
			if(N[n]==N[n+1]&&N[n+1]==0) {
				N[n+1]=1;
				res++;
			}else if(N[n]==N[n+1]&&N[n+1]==1) {
				N[n+1]=0;
				res++;
			}
		}

		System.out.println(res);
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int res = 0;
		String str = sc.next();
		int[] N = new int[str.length()];

		for(int i = 0;i<str.length();i++) {
			N[i]=str.charAt(i)-'0';
			//System.out.println(N[i]);
		}
		for(int n = 0;n<str.length()-1;n++) {
			if(N[n]==N[n+1]&&N[n+1]==0) {
				N[n+1]=1;
				res++;
			}else if(N[n]==N[n+1]&&N[n+1]==1) {
				N[n+1]=0;
				res++;
			}
		}

		System.out.println(res);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int res = 0; res 0 String str = sc.next(); str sc.next() sc.next sc int[] N = new int[str.length()]; N new int[str.length()] str.length() str.length str for(int i = 0;i<str.length();i++) {
			N[i]=str.charAt(i)-'0';
			//System.out.println(N[i]);
		} int i = 0; int i = 0; i 0 i<str.length() i str.length() str.length str i++ i++ i {
			N[i]=str.charAt(i)-'0';
			//System.out.println(N[i]);
		} {
			N[i]=str.charAt(i)-'0';
			//System.out.println(N[i]);
		} N[i]=str.charAt(i)-'0' N[i] N i str.charAt(i)-'0' str.charAt(i) str.charAt str i '0' for(int n = 0;n<str.length()-1;n++) {
			if(N[n]==N[n+1]&&N[n+1]==0) {
				N[n+1]=1;
				res++;
			}else if(N[n]==N[n+1]&&N[n+1]==1) {
				N[n+1]=0;
				res++;
			}
		} int n = 0; int n = 0; n 0 n<str.length()-1 n str.length()-1 str.length() str.length str 1 n++ n++ n {
			if(N[n]==N[n+1]&&N[n+1]==0) {
				N[n+1]=1;
				res++;
			}else if(N[n]==N[n+1]&&N[n+1]==1) {
				N[n+1]=0;
				res++;
			}
		} {
			if(N[n]==N[n+1]&&N[n+1]==0) {
				N[n+1]=1;
				res++;
			}else if(N[n]==N[n+1]&&N[n+1]==1) {
				N[n+1]=0;
				res++;
			}
		} if(N[n]==N[n+1]&&N[n+1]==0) {
				N[n+1]=1;
				res++;
			}else if(N[n]==N[n+1]&&N[n+1]==1) {
				N[n+1]=0;
				res++;
			} N[n]==N[n+1]&&N[n+1]==0 N[n]==N[n+1] N[n] N n N[n+1] N n+1 n 1 N[n+1]==0 N[n+1] N n+1 n 1 0 {
				N[n+1]=1;
				res++;
			} N[n+1]=1 N[n+1] N n+1 n 1 1 res++ res if(N[n]==N[n+1]&&N[n+1]==1) {
				N[n+1]=0;
				res++;
			} N[n]==N[n+1]&&N[n+1]==1 N[n]==N[n+1] N[n] N n N[n+1] N n+1 n 1 N[n+1]==1 N[n+1] N n+1 n 1 1 {
				N[n+1]=0;
				res++;
			} N[n+1]=0 N[n+1] N n+1 n 1 0 res++ res System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main {


	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int res = 0;
		String str = sc.next();
		int[] N = new int[str.length()];

		for(int i = 0;i<str.length();i++) {
			N[i]=str.charAt(i)-'0';
			//System.out.println(N[i]);
		}
		for(int n = 0;n<str.length()-1;n++) {
			if(N[n]==N[n+1]&&N[n+1]==0) {
				N[n+1]=1;
				res++;
			}else if(N[n]==N[n+1]&&N[n+1]==1) {
				N[n+1]=0;
				res++;
			}
		}

		System.out.println(res);
	}
} public class Main {


	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int res = 0;
		String str = sc.next();
		int[] N = new int[str.length()];

		for(int i = 0;i<str.length();i++) {
			N[i]=str.charAt(i)-'0';
			//System.out.println(N[i]);
		}
		for(int n = 0;n<str.length()-1;n++) {
			if(N[n]==N[n+1]&&N[n+1]==0) {
				N[n+1]=1;
				res++;
			}else if(N[n]==N[n+1]&&N[n+1]==1) {
				N[n+1]=0;
				res++;
			}
		}

		System.out.println(res);
	}
} Main
import java.util.Scanner;


public class Main {


	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int res = 0;
		String str = sc.next();
		int[] N = new int[str.length()];

		for(int i = 0;i<str.length();i++) {
			N[i]=str.charAt(i)-'0';
			//System.out.println(N[i]);
		}
		for(int n = 0;n<str.length()-1;n++) {
			if(N[n]==N[n+1]&&N[n+1]==0) {
				N[n+1]=1;
				res++;
			}else if(N[n]==N[n+1]&&N[n+1]==1) {
				N[n+1]=0;
				res++;
			}
		}

		System.out.println(res);
	}
}