import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String S = sc.nextLine();
		String[] SS = S.split("",S.length());
		int[] N = new int[SS.length];

		for(int i=0;i<S.length();i++){
			N[i] = Integer.parseInt(SS[i]);
		}
		int ans = 0;

		for(int j =0;j<N.length-1;j++){
			if(N.length==1)break;
			if(N[j]==N[j+1]&&N[j+1]==1){
				N[j+1] = 0;
				ans++;
			}else if(N[j]==N[j+1]&&N[j+1]==0){
				N[j+1] = 1;
				ans++;
			}
		}
		System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String S = sc.nextLine();
		String[] SS = S.split("",S.length());
		int[] N = new int[SS.length];

		for(int i=0;i<S.length();i++){
			N[i] = Integer.parseInt(SS[i]);
		}
		int ans = 0;

		for(int j =0;j<N.length-1;j++){
			if(N.length==1)break;
			if(N[j]==N[j+1]&&N[j+1]==1){
				N[j+1] = 0;
				ans++;
			}else if(N[j]==N[j+1]&&N[j+1]==0){
				N[j+1] = 1;
				ans++;
			}
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String S = sc.nextLine();
		String[] SS = S.split("",S.length());
		int[] N = new int[SS.length];

		for(int i=0;i<S.length();i++){
			N[i] = Integer.parseInt(SS[i]);
		}
		int ans = 0;

		for(int j =0;j<N.length-1;j++){
			if(N.length==1)break;
			if(N[j]==N[j+1]&&N[j+1]==1){
				N[j+1] = 0;
				ans++;
			}else if(N[j]==N[j+1]&&N[j+1]==0){
				N[j+1] = 1;
				ans++;
			}
		}
		System.out.println(ans);
	} main {

		Scanner sc = new Scanner(System.in);
		String S = sc.nextLine();
		String[] SS = S.split("",S.length());
		int[] N = new int[SS.length];

		for(int i=0;i<S.length();i++){
			N[i] = Integer.parseInt(SS[i]);
		}
		int ans = 0;

		for(int j =0;j<N.length-1;j++){
			if(N.length==1)break;
			if(N[j]==N[j+1]&&N[j+1]==1){
				N[j+1] = 0;
				ans++;
			}else if(N[j]==N[j+1]&&N[j+1]==0){
				N[j+1] = 1;
				ans++;
			}
		}
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc String[] SS = S.split("",S.length()); SS S.split("",S.length()) S.split S "" S.length() S.length S int[] N = new int[SS.length]; N new int[SS.length] SS.length SS SS.length for(int i=0;i<S.length();i++){
			N[i] = Integer.parseInt(SS[i]);
		} int i=0; int i=0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
			N[i] = Integer.parseInt(SS[i]);
		} {
			N[i] = Integer.parseInt(SS[i]);
		} N[i] = Integer.parseInt(SS[i]) N[i] N i Integer.parseInt(SS[i]) Integer.parseInt Integer SS[i] SS i int ans = 0; ans 0 for(int j =0;j<N.length-1;j++){
			if(N.length==1)break;
			if(N[j]==N[j+1]&&N[j+1]==1){
				N[j+1] = 0;
				ans++;
			}else if(N[j]==N[j+1]&&N[j+1]==0){
				N[j+1] = 1;
				ans++;
			}
		} int j =0; int j =0; j 0 j<N.length-1 j N.length-1 N.length N N.length 1 j++ j++ j {
			if(N.length==1)break;
			if(N[j]==N[j+1]&&N[j+1]==1){
				N[j+1] = 0;
				ans++;
			}else if(N[j]==N[j+1]&&N[j+1]==0){
				N[j+1] = 1;
				ans++;
			}
		} {
			if(N.length==1)break;
			if(N[j]==N[j+1]&&N[j+1]==1){
				N[j+1] = 0;
				ans++;
			}else if(N[j]==N[j+1]&&N[j+1]==0){
				N[j+1] = 1;
				ans++;
			}
		} if(N.length==1)break; N.length==1 N.length N N.length 1 break; if(N[j]==N[j+1]&&N[j+1]==1){
				N[j+1] = 0;
				ans++;
			}else if(N[j]==N[j+1]&&N[j+1]==0){
				N[j+1] = 1;
				ans++;
			} N[j]==N[j+1]&&N[j+1]==1 N[j]==N[j+1] N[j] N j N[j+1] N j+1 j 1 N[j+1]==1 N[j+1] N j+1 j 1 1 {
				N[j+1] = 0;
				ans++;
			} N[j+1] = 0 N[j+1] N j+1 j 1 0 ans++ ans if(N[j]==N[j+1]&&N[j+1]==0){
				N[j+1] = 1;
				ans++;
			} N[j]==N[j+1]&&N[j+1]==0 N[j]==N[j+1] N[j] N j N[j+1] N j+1 j 1 N[j+1]==0 N[j+1] N j+1 j 1 0 {
				N[j+1] = 1;
				ans++;
			} N[j+1] = 1 N[j+1] N j+1 j 1 1 ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String S = sc.nextLine();
		String[] SS = S.split("",S.length());
		int[] N = new int[SS.length];

		for(int i=0;i<S.length();i++){
			N[i] = Integer.parseInt(SS[i]);
		}
		int ans = 0;

		for(int j =0;j<N.length-1;j++){
			if(N.length==1)break;
			if(N[j]==N[j+1]&&N[j+1]==1){
				N[j+1] = 0;
				ans++;
			}else if(N[j]==N[j+1]&&N[j+1]==0){
				N[j+1] = 1;
				ans++;
			}
		}
		System.out.println(ans);
	}
} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String S = sc.nextLine();
		String[] SS = S.split("",S.length());
		int[] N = new int[SS.length];

		for(int i=0;i<S.length();i++){
			N[i] = Integer.parseInt(SS[i]);
		}
		int ans = 0;

		for(int j =0;j<N.length-1;j++){
			if(N.length==1)break;
			if(N[j]==N[j+1]&&N[j+1]==1){
				N[j+1] = 0;
				ans++;
			}else if(N[j]==N[j+1]&&N[j+1]==0){
				N[j+1] = 1;
				ans++;
			}
		}
		System.out.println(ans);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String S = sc.nextLine();
		String[] SS = S.split("",S.length());
		int[] N = new int[SS.length];

		for(int i=0;i<S.length();i++){
			N[i] = Integer.parseInt(SS[i]);
		}
		int ans = 0;

		for(int j =0;j<N.length-1;j++){
			if(N.length==1)break;
			if(N[j]==N[j+1]&&N[j+1]==1){
				N[j+1] = 0;
				ans++;
			}else if(N[j]==N[j+1]&&N[j+1]==0){
				N[j+1] = 1;
				ans++;
			}
		}
		System.out.println(ans);
	}
}