import java.util.Scanner;

public class Main {

	public static void main(final String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] S = sc.next().toCharArray();
		sc.close();
		char before = S[0];
		int ans = 0;
		for(int i = 1; i < S.length; i++) {
			boolean ok = false;
			char s = S[i];
			if((before == '0' && s == '1')
				|| (before == '1' && s == '0')) {
				ok = true;
			} else {
				s = before == '0' ? '1' : '0';
			}
			before = s;
			if(!ok) ans++;
		}
		System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(final String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] S = sc.next().toCharArray();
		sc.close();
		char before = S[0];
		int ans = 0;
		for(int i = 1; i < S.length; i++) {
			boolean ok = false;
			char s = S[i];
			if((before == '0' && s == '1')
				|| (before == '1' && s == '0')) {
				ok = true;
			} else {
				s = before == '0' ? '1' : '0';
			}
			before = s;
			if(!ok) ans++;
		}
		System.out.println(ans);
	}
} Main public static void main(final String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] S = sc.next().toCharArray();
		sc.close();
		char before = S[0];
		int ans = 0;
		for(int i = 1; i < S.length; i++) {
			boolean ok = false;
			char s = S[i];
			if((before == '0' && s == '1')
				|| (before == '1' && s == '0')) {
				ok = true;
			} else {
				s = before == '0' ? '1' : '0';
			}
			before = s;
			if(!ok) ans++;
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		char[] S = sc.next().toCharArray();
		sc.close();
		char before = S[0];
		int ans = 0;
		for(int i = 1; i < S.length; i++) {
			boolean ok = false;
			char s = S[i];
			if((before == '0' && s == '1')
				|| (before == '1' && s == '0')) {
				ok = true;
			} else {
				s = before == '0' ? '1' : '0';
			}
			before = s;
			if(!ok) ans++;
		}
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] S = sc.next().toCharArray(); S sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc sc.close() sc.close sc char before = S[0]; before S[0] S 0 int ans = 0; ans 0 for(int i = 1; i < S.length; i++) {
			boolean ok = false;
			char s = S[i];
			if((before == '0' && s == '1')
				|| (before == '1' && s == '0')) {
				ok = true;
			} else {
				s = before == '0' ? '1' : '0';
			}
			before = s;
			if(!ok) ans++;
		} int i = 1; int i = 1; i 1 i < S.length i S.length S S.length i++ i++ i {
			boolean ok = false;
			char s = S[i];
			if((before == '0' && s == '1')
				|| (before == '1' && s == '0')) {
				ok = true;
			} else {
				s = before == '0' ? '1' : '0';
			}
			before = s;
			if(!ok) ans++;
		} {
			boolean ok = false;
			char s = S[i];
			if((before == '0' && s == '1')
				|| (before == '1' && s == '0')) {
				ok = true;
			} else {
				s = before == '0' ? '1' : '0';
			}
			before = s;
			if(!ok) ans++;
		} boolean ok = false; ok false char s = S[i]; s S[i] S i if((before == '0' && s == '1')
				|| (before == '1' && s == '0')) {
				ok = true;
			} else {
				s = before == '0' ? '1' : '0';
			} (before == '0' && s == '1')
				|| (before == '1' && s == '0') (before == '0' && s == '1') before == '0' before '0' s == '1' s '1' (before == '1' && s == '0') before == '1' before '1' s == '0' s '0' {
				ok = true;
			} ok = true ok true {
				s = before == '0' ? '1' : '0';
			} s = before == '0' ? '1' : '0' s before == '0' ? '1' : '0' before == '0' before '0' '1' '0' before = s before s if(!ok) ans++; !ok ok ans++ ans System.out.println(ans) System.out.println System.out System System.out ans final String[] args args public class Main {

	public static void main(final String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] S = sc.next().toCharArray();
		sc.close();
		char before = S[0];
		int ans = 0;
		for(int i = 1; i < S.length; i++) {
			boolean ok = false;
			char s = S[i];
			if((before == '0' && s == '1')
				|| (before == '1' && s == '0')) {
				ok = true;
			} else {
				s = before == '0' ? '1' : '0';
			}
			before = s;
			if(!ok) ans++;
		}
		System.out.println(ans);
	}
} public class Main {

	public static void main(final String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] S = sc.next().toCharArray();
		sc.close();
		char before = S[0];
		int ans = 0;
		for(int i = 1; i < S.length; i++) {
			boolean ok = false;
			char s = S[i];
			if((before == '0' && s == '1')
				|| (before == '1' && s == '0')) {
				ok = true;
			} else {
				s = before == '0' ? '1' : '0';
			}
			before = s;
			if(!ok) ans++;
		}
		System.out.println(ans);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(final String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] S = sc.next().toCharArray();
		sc.close();
		char before = S[0];
		int ans = 0;
		for(int i = 1; i < S.length; i++) {
			boolean ok = false;
			char s = S[i];
			if((before == '0' && s == '1')
				|| (before == '1' && s == '0')) {
				ok = true;
			} else {
				s = before == '0' ? '1' : '0';
			}
			before = s;
			if(!ok) ans++;
		}
		System.out.println(ans);
	}
}