
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] arrChar = s.toCharArray();
		sc.close();
 
		int diffAns010 = 0;
		// 0101010101....に修正する場合の修正回数
		for (int i = 0; i < arrChar.length; i++) {
			if (i % 2 == 0 && arrChar[i] == '1') {
				diffAns010++;
			} else if (i % 2 == 1 && arrChar[i] == '0') {
				diffAns010++;
			}
		}
 
		int diffAns101 = 0;
		// 1010101010.....に修正する場合の修正回数
		for (int i = 0; i < arrChar.length; i++) {
			if (i % 2 == 0 && arrChar[i] == '0') {
				diffAns101++;
			} else if (i % 2 == 1 && arrChar[i] == '1') {
				diffAns101++;
			}
		}
		//　修正回数が少ないほうの値を返す
		System.out.println(Math.min(diffAns010, diffAns101));
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] arrChar = s.toCharArray();
		sc.close();
 
		int diffAns010 = 0;
		// 0101010101....に修正する場合の修正回数
		for (int i = 0; i < arrChar.length; i++) {
			if (i % 2 == 0 && arrChar[i] == '1') {
				diffAns010++;
			} else if (i % 2 == 1 && arrChar[i] == '0') {
				diffAns010++;
			}
		}
 
		int diffAns101 = 0;
		// 1010101010.....に修正する場合の修正回数
		for (int i = 0; i < arrChar.length; i++) {
			if (i % 2 == 0 && arrChar[i] == '0') {
				diffAns101++;
			} else if (i % 2 == 1 && arrChar[i] == '1') {
				diffAns101++;
			}
		}
		//　修正回数が少ないほうの値を返す
		System.out.println(Math.min(diffAns010, diffAns101));
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] arrChar = s.toCharArray();
		sc.close();
 
		int diffAns010 = 0;
		// 0101010101....に修正する場合の修正回数
		for (int i = 0; i < arrChar.length; i++) {
			if (i % 2 == 0 && arrChar[i] == '1') {
				diffAns010++;
			} else if (i % 2 == 1 && arrChar[i] == '0') {
				diffAns010++;
			}
		}
 
		int diffAns101 = 0;
		// 1010101010.....に修正する場合の修正回数
		for (int i = 0; i < arrChar.length; i++) {
			if (i % 2 == 0 && arrChar[i] == '0') {
				diffAns101++;
			} else if (i % 2 == 1 && arrChar[i] == '1') {
				diffAns101++;
			}
		}
		//　修正回数が少ないほうの値を返す
		System.out.println(Math.min(diffAns010, diffAns101));
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] arrChar = s.toCharArray();
		sc.close();
 
		int diffAns010 = 0;
		// 0101010101....に修正する場合の修正回数
		for (int i = 0; i < arrChar.length; i++) {
			if (i % 2 == 0 && arrChar[i] == '1') {
				diffAns010++;
			} else if (i % 2 == 1 && arrChar[i] == '0') {
				diffAns010++;
			}
		}
 
		int diffAns101 = 0;
		// 1010101010.....に修正する場合の修正回数
		for (int i = 0; i < arrChar.length; i++) {
			if (i % 2 == 0 && arrChar[i] == '0') {
				diffAns101++;
			} else if (i % 2 == 1 && arrChar[i] == '1') {
				diffAns101++;
			}
		}
		//　修正回数が少ないほうの値を返す
		System.out.println(Math.min(diffAns010, diffAns101));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc char[] arrChar = s.toCharArray(); arrChar s.toCharArray() s.toCharArray s sc.close() sc.close sc int diffAns010 = 0; diffAns010 0 for (int i = 0; i < arrChar.length; i++) {
			if (i % 2 == 0 && arrChar[i] == '1') {
				diffAns010++;
			} else if (i % 2 == 1 && arrChar[i] == '0') {
				diffAns010++;
			}
		} int i = 0; int i = 0; i 0 i < arrChar.length i arrChar.length arrChar arrChar.length i++ i++ i {
			if (i % 2 == 0 && arrChar[i] == '1') {
				diffAns010++;
			} else if (i % 2 == 1 && arrChar[i] == '0') {
				diffAns010++;
			}
		} {
			if (i % 2 == 0 && arrChar[i] == '1') {
				diffAns010++;
			} else if (i % 2 == 1 && arrChar[i] == '0') {
				diffAns010++;
			}
		} if (i % 2 == 0 && arrChar[i] == '1') {
				diffAns010++;
			} else if (i % 2 == 1 && arrChar[i] == '0') {
				diffAns010++;
			} i % 2 == 0 && arrChar[i] == '1' i % 2 == 0 i % 2 i 2 0 arrChar[i] == '1' arrChar[i] arrChar i '1' {
				diffAns010++;
			} diffAns010++ diffAns010 if (i % 2 == 1 && arrChar[i] == '0') {
				diffAns010++;
			} i % 2 == 1 && arrChar[i] == '0' i % 2 == 1 i % 2 i 2 1 arrChar[i] == '0' arrChar[i] arrChar i '0' {
				diffAns010++;
			} diffAns010++ diffAns010 int diffAns101 = 0; diffAns101 0 for (int i = 0; i < arrChar.length; i++) {
			if (i % 2 == 0 && arrChar[i] == '0') {
				diffAns101++;
			} else if (i % 2 == 1 && arrChar[i] == '1') {
				diffAns101++;
			}
		} int i = 0; int i = 0; i 0 i < arrChar.length i arrChar.length arrChar arrChar.length i++ i++ i {
			if (i % 2 == 0 && arrChar[i] == '0') {
				diffAns101++;
			} else if (i % 2 == 1 && arrChar[i] == '1') {
				diffAns101++;
			}
		} {
			if (i % 2 == 0 && arrChar[i] == '0') {
				diffAns101++;
			} else if (i % 2 == 1 && arrChar[i] == '1') {
				diffAns101++;
			}
		} if (i % 2 == 0 && arrChar[i] == '0') {
				diffAns101++;
			} else if (i % 2 == 1 && arrChar[i] == '1') {
				diffAns101++;
			} i % 2 == 0 && arrChar[i] == '0' i % 2 == 0 i % 2 i 2 0 arrChar[i] == '0' arrChar[i] arrChar i '0' {
				diffAns101++;
			} diffAns101++ diffAns101 if (i % 2 == 1 && arrChar[i] == '1') {
				diffAns101++;
			} i % 2 == 1 && arrChar[i] == '1' i % 2 == 1 i % 2 i 2 1 arrChar[i] == '1' arrChar[i] arrChar i '1' {
				diffAns101++;
			} diffAns101++ diffAns101 System.out.println(Math.min(diffAns010, diffAns101)) System.out.println System.out System System.out Math.min(diffAns010, diffAns101) Math.min Math diffAns010 diffAns101 String[] args args public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] arrChar = s.toCharArray();
		sc.close();
 
		int diffAns010 = 0;
		// 0101010101....に修正する場合の修正回数
		for (int i = 0; i < arrChar.length; i++) {
			if (i % 2 == 0 && arrChar[i] == '1') {
				diffAns010++;
			} else if (i % 2 == 1 && arrChar[i] == '0') {
				diffAns010++;
			}
		}
 
		int diffAns101 = 0;
		// 1010101010.....に修正する場合の修正回数
		for (int i = 0; i < arrChar.length; i++) {
			if (i % 2 == 0 && arrChar[i] == '0') {
				diffAns101++;
			} else if (i % 2 == 1 && arrChar[i] == '1') {
				diffAns101++;
			}
		}
		//　修正回数が少ないほうの値を返す
		System.out.println(Math.min(diffAns010, diffAns101));
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] arrChar = s.toCharArray();
		sc.close();
 
		int diffAns010 = 0;
		// 0101010101....に修正する場合の修正回数
		for (int i = 0; i < arrChar.length; i++) {
			if (i % 2 == 0 && arrChar[i] == '1') {
				diffAns010++;
			} else if (i % 2 == 1 && arrChar[i] == '0') {
				diffAns010++;
			}
		}
 
		int diffAns101 = 0;
		// 1010101010.....に修正する場合の修正回数
		for (int i = 0; i < arrChar.length; i++) {
			if (i % 2 == 0 && arrChar[i] == '0') {
				diffAns101++;
			} else if (i % 2 == 1 && arrChar[i] == '1') {
				diffAns101++;
			}
		}
		//　修正回数が少ないほうの値を返す
		System.out.println(Math.min(diffAns010, diffAns101));
	}
} Main

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] arrChar = s.toCharArray();
		sc.close();
 
		int diffAns010 = 0;
		// 0101010101....に修正する場合の修正回数
		for (int i = 0; i < arrChar.length; i++) {
			if (i % 2 == 0 && arrChar[i] == '1') {
				diffAns010++;
			} else if (i % 2 == 1 && arrChar[i] == '0') {
				diffAns010++;
			}
		}
 
		int diffAns101 = 0;
		// 1010101010.....に修正する場合の修正回数
		for (int i = 0; i < arrChar.length; i++) {
			if (i % 2 == 0 && arrChar[i] == '0') {
				diffAns101++;
			} else if (i % 2 == 1 && arrChar[i] == '1') {
				diffAns101++;
			}
		}
		//　修正回数が少ないほうの値を返す
		System.out.println(Math.min(diffAns010, diffAns101));
	}
}