import java.util.*;
import java.io.*;

public class Main {
	public static void main(String[] args) {
		FastScanner br = new FastScanner();
		StringBuilder n = new StringBuilder(br.nt());
		StringBuilder m = new StringBuilder(n.toString());
		int cont1 = 0, cont2 = 0;
		for(int i = 1;i<n.length();i++) {
			if(n.charAt(i)==n.charAt(i-1)) {
				if(n.charAt(i)=='1')n.setCharAt(i, '0');
				else if(n.charAt(i)=='0')n.setCharAt(i, '1');
				cont1++;
			}
		}for(int i = n.length()-2;i>=0;i--) {
			if(m.charAt(i)==m.charAt(i+1)) {
				if(m.charAt(i)=='1')m.setCharAt(i, '0');
				else if(m.charAt(i)=='0')m.setCharAt(i, '1');
				cont2++;
			}
		}
		System.out.println(Math.min(cont1, cont2));
	}
}

class FastScanner {
	BufferedReader br;
	StringTokenizer st;

	public FastScanner(String s) {
		try {
			br = new BufferedReader(new FileReader(s));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	}

	public FastScanner() {
		br = new BufferedReader(new InputStreamReader(System.in));
	}

	ArrayList<Integer>[] ng(int n, int e) {
		ArrayList<Integer>[] adj = new ArrayList[n];
		for (int i = 0; i < n; i++) {
			adj[i] = new ArrayList<Integer>();
		}
		for (int i = 0; i < e; i++) {
			int a = ni() - 1;
			int b = ni() - 1;
			adj[a].add(b);
			adj[b].add(a);
		}
		return adj;
	}

	Integer[] nIa(int n) {
		Integer[] arr = new Integer[n];
		for (int i = 0; i < n; i++) {
			arr[i] = ni();
		}
		return arr;
	}

	int[] nia(int n) {
		int[] arr = new int[n];
		for (int i = 0; i < n; i++) {
			arr[i] = ni();
		}
		return arr;
	}

	Long[] nLa(int n) {
		Long[] arr = new Long[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nl();
		}
		return arr;
	}

	long[] nla(int n) {
		long[] arr = new long[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nl();
		}
		return arr;
	}

	String[] nsa(int n) {
		String[] arr = new String[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nt();
		}
		return arr;
	}

	String nt() {
		while (st == null || !st.hasMoreElements()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return st.nextToken();
	}

	int ni() {
		return Integer.parseInt(nt());
	}

	long nl() {
		return Long.parseLong(nt());
	}

	double nd() {
		return Double.parseDouble(nt());
	}

} import java.util.*; util.* java import java.io.*; io.* java public class Main {
	public static void main(String[] args) {
		FastScanner br = new FastScanner();
		StringBuilder n = new StringBuilder(br.nt());
		StringBuilder m = new StringBuilder(n.toString());
		int cont1 = 0, cont2 = 0;
		for(int i = 1;i<n.length();i++) {
			if(n.charAt(i)==n.charAt(i-1)) {
				if(n.charAt(i)=='1')n.setCharAt(i, '0');
				else if(n.charAt(i)=='0')n.setCharAt(i, '1');
				cont1++;
			}
		}for(int i = n.length()-2;i>=0;i--) {
			if(m.charAt(i)==m.charAt(i+1)) {
				if(m.charAt(i)=='1')m.setCharAt(i, '0');
				else if(m.charAt(i)=='0')m.setCharAt(i, '1');
				cont2++;
			}
		}
		System.out.println(Math.min(cont1, cont2));
	}
} Main public static void main(String[] args) {
		FastScanner br = new FastScanner();
		StringBuilder n = new StringBuilder(br.nt());
		StringBuilder m = new StringBuilder(n.toString());
		int cont1 = 0, cont2 = 0;
		for(int i = 1;i<n.length();i++) {
			if(n.charAt(i)==n.charAt(i-1)) {
				if(n.charAt(i)=='1')n.setCharAt(i, '0');
				else if(n.charAt(i)=='0')n.setCharAt(i, '1');
				cont1++;
			}
		}for(int i = n.length()-2;i>=0;i--) {
			if(m.charAt(i)==m.charAt(i+1)) {
				if(m.charAt(i)=='1')m.setCharAt(i, '0');
				else if(m.charAt(i)=='0')m.setCharAt(i, '1');
				cont2++;
			}
		}
		System.out.println(Math.min(cont1, cont2));
	} main {
		FastScanner br = new FastScanner();
		StringBuilder n = new StringBuilder(br.nt());
		StringBuilder m = new StringBuilder(n.toString());
		int cont1 = 0, cont2 = 0;
		for(int i = 1;i<n.length();i++) {
			if(n.charAt(i)==n.charAt(i-1)) {
				if(n.charAt(i)=='1')n.setCharAt(i, '0');
				else if(n.charAt(i)=='0')n.setCharAt(i, '1');
				cont1++;
			}
		}for(int i = n.length()-2;i>=0;i--) {
			if(m.charAt(i)==m.charAt(i+1)) {
				if(m.charAt(i)=='1')m.setCharAt(i, '0');
				else if(m.charAt(i)=='0')m.setCharAt(i, '1');
				cont2++;
			}
		}
		System.out.println(Math.min(cont1, cont2));
	} FastScanner br = new FastScanner(); br new FastScanner() StringBuilder n = new StringBuilder(br.nt()); n new StringBuilder(br.nt()) StringBuilder m = new StringBuilder(n.toString()); m new StringBuilder(n.toString()) int cont1 = 0 cont1 0 cont2 = 0; cont2 0 for(int i = 1;i<n.length();i++) {
			if(n.charAt(i)==n.charAt(i-1)) {
				if(n.charAt(i)=='1')n.setCharAt(i, '0');
				else if(n.charAt(i)=='0')n.setCharAt(i, '1');
				cont1++;
			}
		} int i = 1; int i = 1; i 1 i<n.length() i n.length() n.length n i++ i++ i {
			if(n.charAt(i)==n.charAt(i-1)) {
				if(n.charAt(i)=='1')n.setCharAt(i, '0');
				else if(n.charAt(i)=='0')n.setCharAt(i, '1');
				cont1++;
			}
		} {
			if(n.charAt(i)==n.charAt(i-1)) {
				if(n.charAt(i)=='1')n.setCharAt(i, '0');
				else if(n.charAt(i)=='0')n.setCharAt(i, '1');
				cont1++;
			}
		} if(n.charAt(i)==n.charAt(i-1)) {
				if(n.charAt(i)=='1')n.setCharAt(i, '0');
				else if(n.charAt(i)=='0')n.setCharAt(i, '1');
				cont1++;
			} n.charAt(i)==n.charAt(i-1) n.charAt(i) n.charAt n i n.charAt(i-1) n.charAt n i-1 i 1 {
				if(n.charAt(i)=='1')n.setCharAt(i, '0');
				else if(n.charAt(i)=='0')n.setCharAt(i, '1');
				cont1++;
			} if(n.charAt(i)=='1')n.setCharAt(i, '0');
				else if(n.charAt(i)=='0')n.setCharAt(i, '1'); n.charAt(i)=='1' n.charAt(i) n.charAt n i '1' n.setCharAt(i, '0') n.setCharAt n i '0' if(n.charAt(i)=='0')n.setCharAt(i, '1'); n.charAt(i)=='0' n.charAt(i) n.charAt n i '0' n.setCharAt(i, '1') n.setCharAt n i '1' cont1++ cont1 for(int i = n.length()-2;i>=0;i--) {
			if(m.charAt(i)==m.charAt(i+1)) {
				if(m.charAt(i)=='1')m.setCharAt(i, '0');
				else if(m.charAt(i)=='0')m.setCharAt(i, '1');
				cont2++;
			}
		} int i = n.length()-2; int i = n.length()-2; i n.length()-2 n.length() n.length n 2 i>=0 i 0 i-- i-- i {
			if(m.charAt(i)==m.charAt(i+1)) {
				if(m.charAt(i)=='1')m.setCharAt(i, '0');
				else if(m.charAt(i)=='0')m.setCharAt(i, '1');
				cont2++;
			}
		} {
			if(m.charAt(i)==m.charAt(i+1)) {
				if(m.charAt(i)=='1')m.setCharAt(i, '0');
				else if(m.charAt(i)=='0')m.setCharAt(i, '1');
				cont2++;
			}
		} if(m.charAt(i)==m.charAt(i+1)) {
				if(m.charAt(i)=='1')m.setCharAt(i, '0');
				else if(m.charAt(i)=='0')m.setCharAt(i, '1');
				cont2++;
			} m.charAt(i)==m.charAt(i+1) m.charAt(i) m.charAt m i m.charAt(i+1) m.charAt m i+1 i 1 {
				if(m.charAt(i)=='1')m.setCharAt(i, '0');
				else if(m.charAt(i)=='0')m.setCharAt(i, '1');
				cont2++;
			} if(m.charAt(i)=='1')m.setCharAt(i, '0');
				else if(m.charAt(i)=='0')m.setCharAt(i, '1'); m.charAt(i)=='1' m.charAt(i) m.charAt m i '1' m.setCharAt(i, '0') m.setCharAt m i '0' if(m.charAt(i)=='0')m.setCharAt(i, '1'); m.charAt(i)=='0' m.charAt(i) m.charAt m i '0' m.setCharAt(i, '1') m.setCharAt m i '1' cont2++ cont2 System.out.println(Math.min(cont1, cont2)) System.out.println System.out System System.out Math.min(cont1, cont2) Math.min Math cont1 cont2 String[] args args class FastScanner {
	BufferedReader br;
	StringTokenizer st;

	public FastScanner(String s) {
		try {
			br = new BufferedReader(new FileReader(s));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	}

	public FastScanner() {
		br = new BufferedReader(new InputStreamReader(System.in));
	}

	ArrayList<Integer>[] ng(int n, int e) {
		ArrayList<Integer>[] adj = new ArrayList[n];
		for (int i = 0; i < n; i++) {
			adj[i] = new ArrayList<Integer>();
		}
		for (int i = 0; i < e; i++) {
			int a = ni() - 1;
			int b = ni() - 1;
			adj[a].add(b);
			adj[b].add(a);
		}
		return adj;
	}

	Integer[] nIa(int n) {
		Integer[] arr = new Integer[n];
		for (int i = 0; i < n; i++) {
			arr[i] = ni();
		}
		return arr;
	}

	int[] nia(int n) {
		int[] arr = new int[n];
		for (int i = 0; i < n; i++) {
			arr[i] = ni();
		}
		return arr;
	}

	Long[] nLa(int n) {
		Long[] arr = new Long[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nl();
		}
		return arr;
	}

	long[] nla(int n) {
		long[] arr = new long[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nl();
		}
		return arr;
	}

	String[] nsa(int n) {
		String[] arr = new String[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nt();
		}
		return arr;
	}

	String nt() {
		while (st == null || !st.hasMoreElements()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return st.nextToken();
	}

	int ni() {
		return Integer.parseInt(nt());
	}

	long nl() {
		return Long.parseLong(nt());
	}

	double nd() {
		return Double.parseDouble(nt());
	}

} FastScanner BufferedReader br; br StringTokenizer st; st public FastScanner(String s) {
		try {
			br = new BufferedReader(new FileReader(s));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	} FastScanner {
		try {
			br = new BufferedReader(new FileReader(s));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	} try {
			br = new BufferedReader(new FileReader(s));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} FileNotFoundException e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			br = new BufferedReader(new FileReader(s));
		} br = new BufferedReader(new FileReader(s)) br new BufferedReader(new FileReader(s)) String s s public FastScanner() {
		br = new BufferedReader(new InputStreamReader(System.in));
	} FastScanner {
		br = new BufferedReader(new InputStreamReader(System.in));
	} br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) ArrayList<Integer>[] ng(int n, int e) {
		ArrayList<Integer>[] adj = new ArrayList[n];
		for (int i = 0; i < n; i++) {
			adj[i] = new ArrayList<Integer>();
		}
		for (int i = 0; i < e; i++) {
			int a = ni() - 1;
			int b = ni() - 1;
			adj[a].add(b);
			adj[b].add(a);
		}
		return adj;
	} ng {
		ArrayList<Integer>[] adj = new ArrayList[n];
		for (int i = 0; i < n; i++) {
			adj[i] = new ArrayList<Integer>();
		}
		for (int i = 0; i < e; i++) {
			int a = ni() - 1;
			int b = ni() - 1;
			adj[a].add(b);
			adj[b].add(a);
		}
		return adj;
	} ArrayList<Integer>[] adj = new ArrayList[n]; adj new ArrayList[n] n for (int i = 0; i < n; i++) {
			adj[i] = new ArrayList<Integer>();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			adj[i] = new ArrayList<Integer>();
		} {
			adj[i] = new ArrayList<Integer>();
		} adj[i] = new ArrayList<Integer>() adj[i] adj i new ArrayList<Integer>() for (int i = 0; i < e; i++) {
			int a = ni() - 1;
			int b = ni() - 1;
			adj[a].add(b);
			adj[b].add(a);
		} int i = 0; int i = 0; i 0 i < e i e i++ i++ i {
			int a = ni() - 1;
			int b = ni() - 1;
			adj[a].add(b);
			adj[b].add(a);
		} {
			int a = ni() - 1;
			int b = ni() - 1;
			adj[a].add(b);
			adj[b].add(a);
		} int a = ni() - 1; a ni() - 1 ni() ni 1 int b = ni() - 1; b ni() - 1 ni() ni 1 adj[a].add(b) adj[a].add adj[a] adj a b adj[b].add(a) adj[b].add adj[b] adj b a return adj; adj int n n int e e Integer[] nIa(int n) {
		Integer[] arr = new Integer[n];
		for (int i = 0; i < n; i++) {
			arr[i] = ni();
		}
		return arr;
	} nIa {
		Integer[] arr = new Integer[n];
		for (int i = 0; i < n; i++) {
			arr[i] = ni();
		}
		return arr;
	} Integer[] arr = new Integer[n]; arr new Integer[n] n for (int i = 0; i < n; i++) {
			arr[i] = ni();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			arr[i] = ni();
		} {
			arr[i] = ni();
		} arr[i] = ni() arr[i] arr i ni() ni return arr; arr int n n int[] nia(int n) {
		int[] arr = new int[n];
		for (int i = 0; i < n; i++) {
			arr[i] = ni();
		}
		return arr;
	} nia {
		int[] arr = new int[n];
		for (int i = 0; i < n; i++) {
			arr[i] = ni();
		}
		return arr;
	} int[] arr = new int[n]; arr new int[n] n for (int i = 0; i < n; i++) {
			arr[i] = ni();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			arr[i] = ni();
		} {
			arr[i] = ni();
		} arr[i] = ni() arr[i] arr i ni() ni return arr; arr int n n Long[] nLa(int n) {
		Long[] arr = new Long[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nl();
		}
		return arr;
	} nLa {
		Long[] arr = new Long[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nl();
		}
		return arr;
	} Long[] arr = new Long[n]; arr new Long[n] n for (int i = 0; i < n; i++) {
			arr[i] = nl();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			arr[i] = nl();
		} {
			arr[i] = nl();
		} arr[i] = nl() arr[i] arr i nl() nl return arr; arr int n n long[] nla(int n) {
		long[] arr = new long[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nl();
		}
		return arr;
	} nla {
		long[] arr = new long[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nl();
		}
		return arr;
	} long[] arr = new long[n]; arr new long[n] n for (int i = 0; i < n; i++) {
			arr[i] = nl();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			arr[i] = nl();
		} {
			arr[i] = nl();
		} arr[i] = nl() arr[i] arr i nl() nl return arr; arr int n n String[] nsa(int n) {
		String[] arr = new String[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nt();
		}
		return arr;
	} nsa {
		String[] arr = new String[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nt();
		}
		return arr;
	} String[] arr = new String[n]; arr new String[n] n for (int i = 0; i < n; i++) {
			arr[i] = nt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			arr[i] = nt();
		} {
			arr[i] = nt();
		} arr[i] = nt() arr[i] arr i nt() nt return arr; arr int n n String nt() {
		while (st == null || !st.hasMoreElements()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return st.nextToken();
	} nt {
		while (st == null || !st.hasMoreElements()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return st.nextToken();
	} while (st == null || !st.hasMoreElements()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			}
		} st == null || !st.hasMoreElements() st == null st null !st.hasMoreElements() st.hasMoreElements() st.hasMoreElements st {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			}
		} try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			} catch (IOException e) {
				e.printStackTrace();
			} IOException e {
				e.printStackTrace();
			} e.printStackTrace() e.printStackTrace e {
				st = new StringTokenizer(br.readLine());
			} st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st int ni() {
		return Integer.parseInt(nt());
	} ni {
		return Integer.parseInt(nt());
	} return Integer.parseInt(nt()); Integer.parseInt(nt()) Integer.parseInt Integer nt() nt long nl() {
		return Long.parseLong(nt());
	} nl {
		return Long.parseLong(nt());
	} return Long.parseLong(nt()); Long.parseLong(nt()) Long.parseLong Long nt() nt double nd() {
		return Double.parseDouble(nt());
	} nd {
		return Double.parseDouble(nt());
	} return Double.parseDouble(nt()); Double.parseDouble(nt()) Double.parseDouble Double nt() nt public class Main {
	public static void main(String[] args) {
		FastScanner br = new FastScanner();
		StringBuilder n = new StringBuilder(br.nt());
		StringBuilder m = new StringBuilder(n.toString());
		int cont1 = 0, cont2 = 0;
		for(int i = 1;i<n.length();i++) {
			if(n.charAt(i)==n.charAt(i-1)) {
				if(n.charAt(i)=='1')n.setCharAt(i, '0');
				else if(n.charAt(i)=='0')n.setCharAt(i, '1');
				cont1++;
			}
		}for(int i = n.length()-2;i>=0;i--) {
			if(m.charAt(i)==m.charAt(i+1)) {
				if(m.charAt(i)=='1')m.setCharAt(i, '0');
				else if(m.charAt(i)=='0')m.setCharAt(i, '1');
				cont2++;
			}
		}
		System.out.println(Math.min(cont1, cont2));
	}
} public class Main {
	public static void main(String[] args) {
		FastScanner br = new FastScanner();
		StringBuilder n = new StringBuilder(br.nt());
		StringBuilder m = new StringBuilder(n.toString());
		int cont1 = 0, cont2 = 0;
		for(int i = 1;i<n.length();i++) {
			if(n.charAt(i)==n.charAt(i-1)) {
				if(n.charAt(i)=='1')n.setCharAt(i, '0');
				else if(n.charAt(i)=='0')n.setCharAt(i, '1');
				cont1++;
			}
		}for(int i = n.length()-2;i>=0;i--) {
			if(m.charAt(i)==m.charAt(i+1)) {
				if(m.charAt(i)=='1')m.setCharAt(i, '0');
				else if(m.charAt(i)=='0')m.setCharAt(i, '1');
				cont2++;
			}
		}
		System.out.println(Math.min(cont1, cont2));
	}
} Main
import java.util.*;
import java.io.*;

public class Main {
	public static void main(String[] args) {
		FastScanner br = new FastScanner();
		StringBuilder n = new StringBuilder(br.nt());
		StringBuilder m = new StringBuilder(n.toString());
		int cont1 = 0, cont2 = 0;
		for(int i = 1;i<n.length();i++) {
			if(n.charAt(i)==n.charAt(i-1)) {
				if(n.charAt(i)=='1')n.setCharAt(i, '0');
				else if(n.charAt(i)=='0')n.setCharAt(i, '1');
				cont1++;
			}
		}for(int i = n.length()-2;i>=0;i--) {
			if(m.charAt(i)==m.charAt(i+1)) {
				if(m.charAt(i)=='1')m.setCharAt(i, '0');
				else if(m.charAt(i)=='0')m.setCharAt(i, '1');
				cont2++;
			}
		}
		System.out.println(Math.min(cont1, cont2));
	}
}

class FastScanner {
	BufferedReader br;
	StringTokenizer st;

	public FastScanner(String s) {
		try {
			br = new BufferedReader(new FileReader(s));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	}

	public FastScanner() {
		br = new BufferedReader(new InputStreamReader(System.in));
	}

	ArrayList<Integer>[] ng(int n, int e) {
		ArrayList<Integer>[] adj = new ArrayList[n];
		for (int i = 0; i < n; i++) {
			adj[i] = new ArrayList<Integer>();
		}
		for (int i = 0; i < e; i++) {
			int a = ni() - 1;
			int b = ni() - 1;
			adj[a].add(b);
			adj[b].add(a);
		}
		return adj;
	}

	Integer[] nIa(int n) {
		Integer[] arr = new Integer[n];
		for (int i = 0; i < n; i++) {
			arr[i] = ni();
		}
		return arr;
	}

	int[] nia(int n) {
		int[] arr = new int[n];
		for (int i = 0; i < n; i++) {
			arr[i] = ni();
		}
		return arr;
	}

	Long[] nLa(int n) {
		Long[] arr = new Long[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nl();
		}
		return arr;
	}

	long[] nla(int n) {
		long[] arr = new long[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nl();
		}
		return arr;
	}

	String[] nsa(int n) {
		String[] arr = new String[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nt();
		}
		return arr;
	}

	String nt() {
		while (st == null || !st.hasMoreElements()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return st.nextToken();
	}

	int ni() {
		return Integer.parseInt(nt());
	}

	long nl() {
		return Long.parseLong(nt());
	}

	double nd() {
		return Double.parseDouble(nt());
	}

}