import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {

	// マップのキー
	// 0はじまり
	private final static String ANSWER1 = "answer1";
	// 1はじまり
	private final static String ANSWER2 = "answer2";

	public static void main(String[] args) {
		// 1. 入力データの処理
		Scanner sc = new Scanner(System.in);
		String input = sc.next();
		sc.close();
		int sLength = input.length();

		// 2. 正解となりうる2通りの文字列を作成
		// 決定因子:文字列の長さ
		Map<String, String> answerMap = new HashMap<>();
		answerMap = generateAnswer(sLength);

		// 3. キョリを計算し、少ない方とのキョリを出力
		printAnswer(input, answerMap);

	}

	/**
	 * キョリが小さい方を出力
	 * @param answerMap
	 */
	private static void printAnswer(String input, Map<String, String> answerMap) {
		// ANSWER1とのキョリ
		String result1 = answerMap.get(ANSWER1);
		int dis1 = calcDistance(input, result1);
		String result2 = answerMap.get(ANSWER2);
		int dis2 = calcDistance(input, result2);
		// 比較し、出力
		if(dis1 >= dis2) {
			System.out.println(dis2);
			return;
		} else {
			System.out.println(dis1);
			return;
		}
	}

	/**
	 * キョリの計算
	 * 想定:inputとanswerChoiceは同じ長さ
	 * @param answerChoice
	 * @return
	 */
	private static int calcDistance(String input, String answerChoice) {
		int distance = 0;
		for(int i = 0; i < input.length(); i++) {
			if(input.charAt(i) != answerChoice.charAt(i)) {
				distance += 1;
			}
		}
		return distance;
	}

	/**
	 * 正解となる文字列を格納するマップ作成
	 * @param length
	 * @return
	 */
	private static Map<String, String> generateAnswer(int length) {
		Map<String, String> result = new HashMap<>();
		StringBuilder answer1 = new StringBuilder();
		StringBuilder answer2 = new StringBuilder();
		for(int i = 0; i < length; i++) {
			if(i % 2 == 0) {
				answer1.append("0");
				answer2.append("1");
			} else {
				answer1.append("1");
				answer2.append("0");
			}
		}

		result.put(ANSWER1, answer1.toString());
		result.put(ANSWER2, answer2.toString());
		return result;
	}

} import java.util.HashMap; HashMap java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util public class Main {

	// マップのキー
	// 0はじまり
	private final static String ANSWER1 = "answer1";
	// 1はじまり
	private final static String ANSWER2 = "answer2";

	public static void main(String[] args) {
		// 1. 入力データの処理
		Scanner sc = new Scanner(System.in);
		String input = sc.next();
		sc.close();
		int sLength = input.length();

		// 2. 正解となりうる2通りの文字列を作成
		// 決定因子:文字列の長さ
		Map<String, String> answerMap = new HashMap<>();
		answerMap = generateAnswer(sLength);

		// 3. キョリを計算し、少ない方とのキョリを出力
		printAnswer(input, answerMap);

	}

	/**
	 * キョリが小さい方を出力
	 * @param answerMap
	 */
	private static void printAnswer(String input, Map<String, String> answerMap) {
		// ANSWER1とのキョリ
		String result1 = answerMap.get(ANSWER1);
		int dis1 = calcDistance(input, result1);
		String result2 = answerMap.get(ANSWER2);
		int dis2 = calcDistance(input, result2);
		// 比較し、出力
		if(dis1 >= dis2) {
			System.out.println(dis2);
			return;
		} else {
			System.out.println(dis1);
			return;
		}
	}

	/**
	 * キョリの計算
	 * 想定:inputとanswerChoiceは同じ長さ
	 * @param answerChoice
	 * @return
	 */
	private static int calcDistance(String input, String answerChoice) {
		int distance = 0;
		for(int i = 0; i < input.length(); i++) {
			if(input.charAt(i) != answerChoice.charAt(i)) {
				distance += 1;
			}
		}
		return distance;
	}

	/**
	 * 正解となる文字列を格納するマップ作成
	 * @param length
	 * @return
	 */
	private static Map<String, String> generateAnswer(int length) {
		Map<String, String> result = new HashMap<>();
		StringBuilder answer1 = new StringBuilder();
		StringBuilder answer2 = new StringBuilder();
		for(int i = 0; i < length; i++) {
			if(i % 2 == 0) {
				answer1.append("0");
				answer2.append("1");
			} else {
				answer1.append("1");
				answer2.append("0");
			}
		}

		result.put(ANSWER1, answer1.toString());
		result.put(ANSWER2, answer2.toString());
		return result;
	}

} Main // マップのキー
	// 0はじまり
	private final static String ANSWER1 = "answer1"; ANSWER1 "answer1" // 1はじまり
	private final static String ANSWER2 = "answer2"; ANSWER2 "answer2" public static void main(String[] args) {
		// 1. 入力データの処理
		Scanner sc = new Scanner(System.in);
		String input = sc.next();
		sc.close();
		int sLength = input.length();

		// 2. 正解となりうる2通りの文字列を作成
		// 決定因子:文字列の長さ
		Map<String, String> answerMap = new HashMap<>();
		answerMap = generateAnswer(sLength);

		// 3. キョリを計算し、少ない方とのキョリを出力
		printAnswer(input, answerMap);

	} main {
		// 1. 入力データの処理
		Scanner sc = new Scanner(System.in);
		String input = sc.next();
		sc.close();
		int sLength = input.length();

		// 2. 正解となりうる2通りの文字列を作成
		// 決定因子:文字列の長さ
		Map<String, String> answerMap = new HashMap<>();
		answerMap = generateAnswer(sLength);

		// 3. キョリを計算し、少ない方とのキョリを出力
		printAnswer(input, answerMap);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String input = sc.next(); input sc.next() sc.next sc sc.close() sc.close sc int sLength = input.length(); sLength input.length() input.length input Map<String, String> answerMap = new HashMap<>(); answerMap new HashMap<>() answerMap = generateAnswer(sLength) answerMap generateAnswer(sLength) generateAnswer sLength printAnswer(input, answerMap) printAnswer input answerMap String[] args args /**
	 * キョリが小さい方を出力
	 * @param answerMap
	 */
	private static void printAnswer(String input, Map<String, String> answerMap) {
		// ANSWER1とのキョリ
		String result1 = answerMap.get(ANSWER1);
		int dis1 = calcDistance(input, result1);
		String result2 = answerMap.get(ANSWER2);
		int dis2 = calcDistance(input, result2);
		// 比較し、出力
		if(dis1 >= dis2) {
			System.out.println(dis2);
			return;
		} else {
			System.out.println(dis1);
			return;
		}
	} printAnswer {
		// ANSWER1とのキョリ
		String result1 = answerMap.get(ANSWER1);
		int dis1 = calcDistance(input, result1);
		String result2 = answerMap.get(ANSWER2);
		int dis2 = calcDistance(input, result2);
		// 比較し、出力
		if(dis1 >= dis2) {
			System.out.println(dis2);
			return;
		} else {
			System.out.println(dis1);
			return;
		}
	} String result1 = answerMap.get(ANSWER1); result1 answerMap.get(ANSWER1) answerMap.get answerMap ANSWER1 int dis1 = calcDistance(input, result1); dis1 calcDistance(input, result1) calcDistance input result1 String result2 = answerMap.get(ANSWER2); result2 answerMap.get(ANSWER2) answerMap.get answerMap ANSWER2 int dis2 = calcDistance(input, result2); dis2 calcDistance(input, result2) calcDistance input result2 if(dis1 >= dis2) {
			System.out.println(dis2);
			return;
		} else {
			System.out.println(dis1);
			return;
		} dis1 >= dis2 dis1 dis2 {
			System.out.println(dis2);
			return;
		} System.out.println(dis2) System.out.println System.out System System.out dis2 return; {
			System.out.println(dis1);
			return;
		} System.out.println(dis1) System.out.println System.out System System.out dis1 return; String input input Map<String, String> answerMap answerMap /**
	 * キョリの計算
	 * 想定:inputとanswerChoiceは同じ長さ
	 * @param answerChoice
	 * @return
	 */
	private static int calcDistance(String input, String answerChoice) {
		int distance = 0;
		for(int i = 0; i < input.length(); i++) {
			if(input.charAt(i) != answerChoice.charAt(i)) {
				distance += 1;
			}
		}
		return distance;
	} calcDistance {
		int distance = 0;
		for(int i = 0; i < input.length(); i++) {
			if(input.charAt(i) != answerChoice.charAt(i)) {
				distance += 1;
			}
		}
		return distance;
	} int distance = 0; distance 0 for(int i = 0; i < input.length(); i++) {
			if(input.charAt(i) != answerChoice.charAt(i)) {
				distance += 1;
			}
		} int i = 0; int i = 0; i 0 i < input.length() i input.length() input.length input i++ i++ i {
			if(input.charAt(i) != answerChoice.charAt(i)) {
				distance += 1;
			}
		} {
			if(input.charAt(i) != answerChoice.charAt(i)) {
				distance += 1;
			}
		} if(input.charAt(i) != answerChoice.charAt(i)) {
				distance += 1;
			} input.charAt(i) != answerChoice.charAt(i) input.charAt(i) input.charAt input i answerChoice.charAt(i) answerChoice.charAt answerChoice i {
				distance += 1;
			} distance += 1 distance 1 return distance; distance String input input String answerChoice answerChoice /**
	 * 正解となる文字列を格納するマップ作成
	 * @param length
	 * @return
	 */
	private static Map<String, String> generateAnswer(int length) {
		Map<String, String> result = new HashMap<>();
		StringBuilder answer1 = new StringBuilder();
		StringBuilder answer2 = new StringBuilder();
		for(int i = 0; i < length; i++) {
			if(i % 2 == 0) {
				answer1.append("0");
				answer2.append("1");
			} else {
				answer1.append("1");
				answer2.append("0");
			}
		}

		result.put(ANSWER1, answer1.toString());
		result.put(ANSWER2, answer2.toString());
		return result;
	} generateAnswer {
		Map<String, String> result = new HashMap<>();
		StringBuilder answer1 = new StringBuilder();
		StringBuilder answer2 = new StringBuilder();
		for(int i = 0; i < length; i++) {
			if(i % 2 == 0) {
				answer1.append("0");
				answer2.append("1");
			} else {
				answer1.append("1");
				answer2.append("0");
			}
		}

		result.put(ANSWER1, answer1.toString());
		result.put(ANSWER2, answer2.toString());
		return result;
	} Map<String, String> result = new HashMap<>(); result new HashMap<>() StringBuilder answer1 = new StringBuilder(); answer1 new StringBuilder() StringBuilder answer2 = new StringBuilder(); answer2 new StringBuilder() for(int i = 0; i < length; i++) {
			if(i % 2 == 0) {
				answer1.append("0");
				answer2.append("1");
			} else {
				answer1.append("1");
				answer2.append("0");
			}
		} int i = 0; int i = 0; i 0 i < length i length i++ i++ i {
			if(i % 2 == 0) {
				answer1.append("0");
				answer2.append("1");
			} else {
				answer1.append("1");
				answer2.append("0");
			}
		} {
			if(i % 2 == 0) {
				answer1.append("0");
				answer2.append("1");
			} else {
				answer1.append("1");
				answer2.append("0");
			}
		} if(i % 2 == 0) {
				answer1.append("0");
				answer2.append("1");
			} else {
				answer1.append("1");
				answer2.append("0");
			} i % 2 == 0 i % 2 i 2 0 {
				answer1.append("0");
				answer2.append("1");
			} answer1.append("0") answer1.append answer1 "0" answer2.append("1") answer2.append answer2 "1" {
				answer1.append("1");
				answer2.append("0");
			} answer1.append("1") answer1.append answer1 "1" answer2.append("0") answer2.append answer2 "0" result.put(ANSWER1, answer1.toString()) result.put result ANSWER1 answer1.toString() answer1.toString answer1 result.put(ANSWER2, answer2.toString()) result.put result ANSWER2 answer2.toString() answer2.toString answer2 return result; result int length length public class Main {

	// マップのキー
	// 0はじまり
	private final static String ANSWER1 = "answer1";
	// 1はじまり
	private final static String ANSWER2 = "answer2";

	public static void main(String[] args) {
		// 1. 入力データの処理
		Scanner sc = new Scanner(System.in);
		String input = sc.next();
		sc.close();
		int sLength = input.length();

		// 2. 正解となりうる2通りの文字列を作成
		// 決定因子:文字列の長さ
		Map<String, String> answerMap = new HashMap<>();
		answerMap = generateAnswer(sLength);

		// 3. キョリを計算し、少ない方とのキョリを出力
		printAnswer(input, answerMap);

	}

	/**
	 * キョリが小さい方を出力
	 * @param answerMap
	 */
	private static void printAnswer(String input, Map<String, String> answerMap) {
		// ANSWER1とのキョリ
		String result1 = answerMap.get(ANSWER1);
		int dis1 = calcDistance(input, result1);
		String result2 = answerMap.get(ANSWER2);
		int dis2 = calcDistance(input, result2);
		// 比較し、出力
		if(dis1 >= dis2) {
			System.out.println(dis2);
			return;
		} else {
			System.out.println(dis1);
			return;
		}
	}

	/**
	 * キョリの計算
	 * 想定:inputとanswerChoiceは同じ長さ
	 * @param answerChoice
	 * @return
	 */
	private static int calcDistance(String input, String answerChoice) {
		int distance = 0;
		for(int i = 0; i < input.length(); i++) {
			if(input.charAt(i) != answerChoice.charAt(i)) {
				distance += 1;
			}
		}
		return distance;
	}

	/**
	 * 正解となる文字列を格納するマップ作成
	 * @param length
	 * @return
	 */
	private static Map<String, String> generateAnswer(int length) {
		Map<String, String> result = new HashMap<>();
		StringBuilder answer1 = new StringBuilder();
		StringBuilder answer2 = new StringBuilder();
		for(int i = 0; i < length; i++) {
			if(i % 2 == 0) {
				answer1.append("0");
				answer2.append("1");
			} else {
				answer1.append("1");
				answer2.append("0");
			}
		}

		result.put(ANSWER1, answer1.toString());
		result.put(ANSWER2, answer2.toString());
		return result;
	}

} public class Main {

	// マップのキー
	// 0はじまり
	private final static String ANSWER1 = "answer1";
	// 1はじまり
	private final static String ANSWER2 = "answer2";

	public static void main(String[] args) {
		// 1. 入力データの処理
		Scanner sc = new Scanner(System.in);
		String input = sc.next();
		sc.close();
		int sLength = input.length();

		// 2. 正解となりうる2通りの文字列を作成
		// 決定因子:文字列の長さ
		Map<String, String> answerMap = new HashMap<>();
		answerMap = generateAnswer(sLength);

		// 3. キョリを計算し、少ない方とのキョリを出力
		printAnswer(input, answerMap);

	}

	/**
	 * キョリが小さい方を出力
	 * @param answerMap
	 */
	private static void printAnswer(String input, Map<String, String> answerMap) {
		// ANSWER1とのキョリ
		String result1 = answerMap.get(ANSWER1);
		int dis1 = calcDistance(input, result1);
		String result2 = answerMap.get(ANSWER2);
		int dis2 = calcDistance(input, result2);
		// 比較し、出力
		if(dis1 >= dis2) {
			System.out.println(dis2);
			return;
		} else {
			System.out.println(dis1);
			return;
		}
	}

	/**
	 * キョリの計算
	 * 想定:inputとanswerChoiceは同じ長さ
	 * @param answerChoice
	 * @return
	 */
	private static int calcDistance(String input, String answerChoice) {
		int distance = 0;
		for(int i = 0; i < input.length(); i++) {
			if(input.charAt(i) != answerChoice.charAt(i)) {
				distance += 1;
			}
		}
		return distance;
	}

	/**
	 * 正解となる文字列を格納するマップ作成
	 * @param length
	 * @return
	 */
	private static Map<String, String> generateAnswer(int length) {
		Map<String, String> result = new HashMap<>();
		StringBuilder answer1 = new StringBuilder();
		StringBuilder answer2 = new StringBuilder();
		for(int i = 0; i < length; i++) {
			if(i % 2 == 0) {
				answer1.append("0");
				answer2.append("1");
			} else {
				answer1.append("1");
				answer2.append("0");
			}
		}

		result.put(ANSWER1, answer1.toString());
		result.put(ANSWER2, answer2.toString());
		return result;
	}

} Main
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {

	// マップのキー
	// 0はじまり
	private final static String ANSWER1 = "answer1";
	// 1はじまり
	private final static String ANSWER2 = "answer2";

	public static void main(String[] args) {
		// 1. 入力データの処理
		Scanner sc = new Scanner(System.in);
		String input = sc.next();
		sc.close();
		int sLength = input.length();

		// 2. 正解となりうる2通りの文字列を作成
		// 決定因子:文字列の長さ
		Map<String, String> answerMap = new HashMap<>();
		answerMap = generateAnswer(sLength);

		// 3. キョリを計算し、少ない方とのキョリを出力
		printAnswer(input, answerMap);

	}

	/**
	 * キョリが小さい方を出力
	 * @param answerMap
	 */
	private static void printAnswer(String input, Map<String, String> answerMap) {
		// ANSWER1とのキョリ
		String result1 = answerMap.get(ANSWER1);
		int dis1 = calcDistance(input, result1);
		String result2 = answerMap.get(ANSWER2);
		int dis2 = calcDistance(input, result2);
		// 比較し、出力
		if(dis1 >= dis2) {
			System.out.println(dis2);
			return;
		} else {
			System.out.println(dis1);
			return;
		}
	}

	/**
	 * キョリの計算
	 * 想定:inputとanswerChoiceは同じ長さ
	 * @param answerChoice
	 * @return
	 */
	private static int calcDistance(String input, String answerChoice) {
		int distance = 0;
		for(int i = 0; i < input.length(); i++) {
			if(input.charAt(i) != answerChoice.charAt(i)) {
				distance += 1;
			}
		}
		return distance;
	}

	/**
	 * 正解となる文字列を格納するマップ作成
	 * @param length
	 * @return
	 */
	private static Map<String, String> generateAnswer(int length) {
		Map<String, String> result = new HashMap<>();
		StringBuilder answer1 = new StringBuilder();
		StringBuilder answer2 = new StringBuilder();
		for(int i = 0; i < length; i++) {
			if(i % 2 == 0) {
				answer1.append("0");
				answer2.append("1");
			} else {
				answer1.append("1");
				answer2.append("0");
			}
		}

		result.put(ANSWER1, answer1.toString());
		result.put(ANSWER2, answer2.toString());
		return result;
	}

}
