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



public class Main {
	
	static InputReader in = new InputReader(System.in);
	static PrintWriter out = new PrintWriter(System.out);

	static int MOD = 1000000007;
	static int M = 5005;
	static int oo = (int)1e9;
	
	
	public static void main(String[] args) throws IOException {
		
		char[] ca = in.readString().toCharArray();
		int n = ca.length;
		int[] a = new int[n];
		for(int i=0; i<n; ++i)
			a[i] = ca[i] - '0';
		
//		int[][] dp = new int[n+1][2];
//		for(int i=1; i <= n; ++i) {
//			dp[i][0] = dp[i-1][1] + (c[i-1] == '1' ? 1 : 0);
//			dp[i][1] = dp[i-1][0] + (c[i-1] == '0' ? 1 : 0);
//		}
//		int ans = Math.min( dp[n][0], dp[n][1] );
//		System.out.println(ans);
		
		int cnt1 = 0;
		for(int i=0; i < n; ++i) {
			int x = i % 2;
			if(x != a[i])
				cnt1++;
		}
		int cnt2 = 0;
		for(int i=0; i < n; ++i) {
			int x = 1 - i % 2;
			if(x != a[i])
				cnt2++;
		}
		System.out.println( Math.min(cnt1, cnt2) );
		
		out.close();
	}
	
	
	static void shuffle(int[] a) {
		Random r = new Random();
		for(int i = a.length - 1; i > 0; --i) {
			int si = r.nextInt(i);
			int t = a[si];
			a[si] = a[i];
			a[i] = t;
		}
	}
	
	static int lower_bound(int[] a, int n, int k) {
		int s = 0;
		int e = n;
		int m;
		while (e - s > 0) {
			m = (s + e) / 2;
			if (a[m] < k)
				s = m + 1;
			else
				e = m;
		}
		return e;
	}
	
	static int gcd(int a, int b) {
		return b == 0 ? a : gcd(b, a % b);
	}
	
	static class Pair implements Comparable<Pair> {
		int first, second;

		public Pair(int first, int second) {
			super();
			this.first = first;
			this.second = second;
		}

		@Override
		public int compareTo(Pair o) {
			return this.first != o.first ? this.first - o.first : this.second - o.second;
		}

		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + first;
			result = prime * result + second;
			return result;
		}

		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			Pair other = (Pair) obj;
			if (first != other.first)
				return false;
			if (second != other.second)
				return false;
			return true;
		}
	}
	
	
}



class InputReader {

	private final InputStream stream;
	private final byte[] buf = new byte[8192];
	private int curChar, snumChars;

	public InputReader(InputStream st) {
		this.stream = st;
	}

	public int read() {
		if (snumChars == -1)
			throw new InputMismatchException();
		if (curChar >= snumChars) {
			curChar = 0;
			try {
				snumChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (snumChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public int nextInt() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public long nextLong() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public int[] nextIntArray(int n) {
		int a[] = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = nextInt();
		}
		return a;
	}

	public String readString() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	public String nextLine() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isEndOfLine(c));
		return res.toString();
	}

	public boolean isSpaceChar(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	private boolean isEndOfLine(int c) {
		return c == '\n' || c == '\r' || c == -1;
	}

} import java.io.*; io.* java import java.util.*; util.* java public class Main {
	
	static InputReader in = new InputReader(System.in);
	static PrintWriter out = new PrintWriter(System.out);

	static int MOD = 1000000007;
	static int M = 5005;
	static int oo = (int)1e9;
	
	
	public static void main(String[] args) throws IOException {
		
		char[] ca = in.readString().toCharArray();
		int n = ca.length;
		int[] a = new int[n];
		for(int i=0; i<n; ++i)
			a[i] = ca[i] - '0';
		
//		int[][] dp = new int[n+1][2];
//		for(int i=1; i <= n; ++i) {
//			dp[i][0] = dp[i-1][1] + (c[i-1] == '1' ? 1 : 0);
//			dp[i][1] = dp[i-1][0] + (c[i-1] == '0' ? 1 : 0);
//		}
//		int ans = Math.min( dp[n][0], dp[n][1] );
//		System.out.println(ans);
		
		int cnt1 = 0;
		for(int i=0; i < n; ++i) {
			int x = i % 2;
			if(x != a[i])
				cnt1++;
		}
		int cnt2 = 0;
		for(int i=0; i < n; ++i) {
			int x = 1 - i % 2;
			if(x != a[i])
				cnt2++;
		}
		System.out.println( Math.min(cnt1, cnt2) );
		
		out.close();
	}
	
	
	static void shuffle(int[] a) {
		Random r = new Random();
		for(int i = a.length - 1; i > 0; --i) {
			int si = r.nextInt(i);
			int t = a[si];
			a[si] = a[i];
			a[i] = t;
		}
	}
	
	static int lower_bound(int[] a, int n, int k) {
		int s = 0;
		int e = n;
		int m;
		while (e - s > 0) {
			m = (s + e) / 2;
			if (a[m] < k)
				s = m + 1;
			else
				e = m;
		}
		return e;
	}
	
	static int gcd(int a, int b) {
		return b == 0 ? a : gcd(b, a % b);
	}
	
	static class Pair implements Comparable<Pair> {
		int first, second;

		public Pair(int first, int second) {
			super();
			this.first = first;
			this.second = second;
		}

		@Override
		public int compareTo(Pair o) {
			return this.first != o.first ? this.first - o.first : this.second - o.second;
		}

		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + first;
			result = prime * result + second;
			return result;
		}

		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			Pair other = (Pair) obj;
			if (first != other.first)
				return false;
			if (second != other.second)
				return false;
			return true;
		}
	}
	
	
} Main static InputReader in = new InputReader(System.in); in new InputReader(System.in) static PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) static int MOD = 1000000007; MOD 1000000007 static int M = 5005; M 5005 static int oo = (int)1e9; oo (int)1e9 public static void main(String[] args) throws IOException {
		
		char[] ca = in.readString().toCharArray();
		int n = ca.length;
		int[] a = new int[n];
		for(int i=0; i<n; ++i)
			a[i] = ca[i] - '0';
		
//		int[][] dp = new int[n+1][2];
//		for(int i=1; i <= n; ++i) {
//			dp[i][0] = dp[i-1][1] + (c[i-1] == '1' ? 1 : 0);
//			dp[i][1] = dp[i-1][0] + (c[i-1] == '0' ? 1 : 0);
//		}
//		int ans = Math.min( dp[n][0], dp[n][1] );
//		System.out.println(ans);
		
		int cnt1 = 0;
		for(int i=0; i < n; ++i) {
			int x = i % 2;
			if(x != a[i])
				cnt1++;
		}
		int cnt2 = 0;
		for(int i=0; i < n; ++i) {
			int x = 1 - i % 2;
			if(x != a[i])
				cnt2++;
		}
		System.out.println( Math.min(cnt1, cnt2) );
		
		out.close();
	} main {
		
		char[] ca = in.readString().toCharArray();
		int n = ca.length;
		int[] a = new int[n];
		for(int i=0; i<n; ++i)
			a[i] = ca[i] - '0';
		
//		int[][] dp = new int[n+1][2];
//		for(int i=1; i <= n; ++i) {
//			dp[i][0] = dp[i-1][1] + (c[i-1] == '1' ? 1 : 0);
//			dp[i][1] = dp[i-1][0] + (c[i-1] == '0' ? 1 : 0);
//		}
//		int ans = Math.min( dp[n][0], dp[n][1] );
//		System.out.println(ans);
		
		int cnt1 = 0;
		for(int i=0; i < n; ++i) {
			int x = i % 2;
			if(x != a[i])
				cnt1++;
		}
		int cnt2 = 0;
		for(int i=0; i < n; ++i) {
			int x = 1 - i % 2;
			if(x != a[i])
				cnt2++;
		}
		System.out.println( Math.min(cnt1, cnt2) );
		
		out.close();
	} char[] ca = in.readString().toCharArray(); ca in.readString().toCharArray() in.readString().toCharArray in.readString() in.readString in int n = ca.length; n ca.length ca ca.length int[] a = new int[n]; a new int[n] n for(int i=0; i<n; ++i)
			a[i] = ca[i] - '0'; int i=0; int i=0; i 0 i<n i n ++i ++i i a[i] = ca[i] - '0'; a[i] = ca[i] - '0' a[i] a i ca[i] - '0' ca[i] ca i '0' int cnt1 = 0; cnt1 0 for(int i=0; i < n; ++i) {
			int x = i % 2;
			if(x != a[i])
				cnt1++;
		} int i=0; int i=0; i 0 i < n i n ++i ++i i {
			int x = i % 2;
			if(x != a[i])
				cnt1++;
		} {
			int x = i % 2;
			if(x != a[i])
				cnt1++;
		} int x = i % 2; x i % 2 i 2 if(x != a[i])
				cnt1++; x != a[i] x a[i] a i cnt1++ cnt1 int cnt2 = 0; cnt2 0 for(int i=0; i < n; ++i) {
			int x = 1 - i % 2;
			if(x != a[i])
				cnt2++;
		} int i=0; int i=0; i 0 i < n i n ++i ++i i {
			int x = 1 - i % 2;
			if(x != a[i])
				cnt2++;
		} {
			int x = 1 - i % 2;
			if(x != a[i])
				cnt2++;
		} int x = 1 - i % 2; x 1 - i % 2 1 i % 2 i 2 if(x != a[i])
				cnt2++; x != a[i] x a[i] a i cnt2++ cnt2 System.out.println( Math.min(cnt1, cnt2) ) System.out.println System.out System System.out Math.min(cnt1, cnt2) Math.min Math cnt1 cnt2 out.close() out.close out String[] args args static void shuffle(int[] a) {
		Random r = new Random();
		for(int i = a.length - 1; i > 0; --i) {
			int si = r.nextInt(i);
			int t = a[si];
			a[si] = a[i];
			a[i] = t;
		}
	} shuffle {
		Random r = new Random();
		for(int i = a.length - 1; i > 0; --i) {
			int si = r.nextInt(i);
			int t = a[si];
			a[si] = a[i];
			a[i] = t;
		}
	} Random r = new Random(); r new Random() for(int i = a.length - 1; i > 0; --i) {
			int si = r.nextInt(i);
			int t = a[si];
			a[si] = a[i];
			a[i] = t;
		} int i = a.length - 1; int i = a.length - 1; i a.length - 1 a.length a a.length 1 i > 0 i 0 --i --i i {
			int si = r.nextInt(i);
			int t = a[si];
			a[si] = a[i];
			a[i] = t;
		} {
			int si = r.nextInt(i);
			int t = a[si];
			a[si] = a[i];
			a[i] = t;
		} int si = r.nextInt(i); si r.nextInt(i) r.nextInt r i int t = a[si]; t a[si] a si a[si] = a[i] a[si] a si a[i] a i a[i] = t a[i] a i t int[] a a static int lower_bound(int[] a, int n, int k) {
		int s = 0;
		int e = n;
		int m;
		while (e - s > 0) {
			m = (s + e) / 2;
			if (a[m] < k)
				s = m + 1;
			else
				e = m;
		}
		return e;
	} lower_bound {
		int s = 0;
		int e = n;
		int m;
		while (e - s > 0) {
			m = (s + e) / 2;
			if (a[m] < k)
				s = m + 1;
			else
				e = m;
		}
		return e;
	} int s = 0; s 0 int e = n; e n int m; m while (e - s > 0) {
			m = (s + e) / 2;
			if (a[m] < k)
				s = m + 1;
			else
				e = m;
		} e - s > 0 e - s e s 0 {
			m = (s + e) / 2;
			if (a[m] < k)
				s = m + 1;
			else
				e = m;
		} m = (s + e) / 2 m (s + e) / 2 (s + e) s e 2 if (a[m] < k)
				s = m + 1;
			else
				e = m; a[m] < k a[m] a m k s = m + 1 s m + 1 m 1 e = m e m return e; e int[] a a int n n int k k static int gcd(int a, int b) {
		return b == 0 ? a : gcd(b, a % b);
	} gcd {
		return b == 0 ? a : gcd(b, a % b);
	} return b == 0 ? a : gcd(b, a % b); b == 0 ? a : gcd(b, a % b) b == 0 b 0 a gcd(b, a % b) gcd b a % b a b int a a int b b static class Pair implements Comparable<Pair> {
		int first, second;

		public Pair(int first, int second) {
			super();
			this.first = first;
			this.second = second;
		}

		@Override
		public int compareTo(Pair o) {
			return this.first != o.first ? this.first - o.first : this.second - o.second;
		}

		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + first;
			result = prime * result + second;
			return result;
		}

		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			Pair other = (Pair) obj;
			if (first != other.first)
				return false;
			if (second != other.second)
				return false;
			return true;
		}
	} Pair int first first second; second public Pair(int first, int second) {
			super();
			this.first = first;
			this.second = second;
		} Pair {
			super();
			this.first = first;
			this.second = second;
		} super() super this.first = first this.first this this.first first this.second = second this.second this this.second second int first first int second second @Override
		public int compareTo(Pair o) {
			return this.first != o.first ? this.first - o.first : this.second - o.second;
		} compareTo {
			return this.first != o.first ? this.first - o.first : this.second - o.second;
		} return this.first != o.first ? this.first - o.first : this.second - o.second; this.first != o.first ? this.first - o.first : this.second - o.second this.first != o.first this.first this this.first o.first o o.first this.first - o.first this.first this this.first o.first o o.first this.second - o.second this.second this this.second o.second o o.second Pair o o @Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + first;
			result = prime * result + second;
			return result;
		} hashCode {
			final int prime = 31;
			int result = 1;
			result = prime * result + first;
			result = prime * result + second;
			return result;
		} final int prime = 31; prime 31 int result = 1; result 1 result = prime * result + first result prime * result + first prime * result prime result first result = prime * result + second result prime * result + second prime * result prime result second return result; result @Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			Pair other = (Pair) obj;
			if (first != other.first)
				return false;
			if (second != other.second)
				return false;
			return true;
		} equals {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			Pair other = (Pair) obj;
			if (first != other.first)
				return false;
			if (second != other.second)
				return false;
			return true;
		} if (this == obj)
				return true; this == obj this obj return true; true if (obj == null)
				return false; obj == null obj null return false; false if (getClass() != obj.getClass())
				return false; getClass() != obj.getClass() getClass() getClass obj.getClass() obj.getClass obj return false; false Pair other = (Pair) obj; other (Pair) obj if (first != other.first)
				return false; first != other.first first other.first other other.first return false; false if (second != other.second)
				return false; second != other.second second other.second other other.second return false; false return true; true Object obj obj Comparable class InputReader {

	private final InputStream stream;
	private final byte[] buf = new byte[8192];
	private int curChar, snumChars;

	public InputReader(InputStream st) {
		this.stream = st;
	}

	public int read() {
		if (snumChars == -1)
			throw new InputMismatchException();
		if (curChar >= snumChars) {
			curChar = 0;
			try {
				snumChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (snumChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public int nextInt() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public long nextLong() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public int[] nextIntArray(int n) {
		int a[] = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = nextInt();
		}
		return a;
	}

	public String readString() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	public String nextLine() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isEndOfLine(c));
		return res.toString();
	}

	public boolean isSpaceChar(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	private boolean isEndOfLine(int c) {
		return c == '\n' || c == '\r' || c == -1;
	}

} InputReader private final InputStream stream; stream private final byte[] buf = new byte[8192]; buf new byte[8192] 8192 private int curChar curChar snumChars; snumChars public InputReader(InputStream st) {
		this.stream = st;
	} InputReader {
		this.stream = st;
	} this.stream = st this.stream this this.stream st InputStream st st public int read() {
		if (snumChars == -1)
			throw new InputMismatchException();
		if (curChar >= snumChars) {
			curChar = 0;
			try {
				snumChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (snumChars <= 0)
				return -1;
		}
		return buf[curChar++];
	} read {
		if (snumChars == -1)
			throw new InputMismatchException();
		if (curChar >= snumChars) {
			curChar = 0;
			try {
				snumChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (snumChars <= 0)
				return -1;
		}
		return buf[curChar++];
	} if (snumChars == -1)
			throw new InputMismatchException(); snumChars == -1 snumChars -1 1 throw new InputMismatchException(); new InputMismatchException() if (curChar >= snumChars) {
			curChar = 0;
			try {
				snumChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (snumChars <= 0)
				return -1;
		} curChar >= snumChars curChar snumChars {
			curChar = 0;
			try {
				snumChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (snumChars <= 0)
				return -1;
		} curChar = 0 curChar 0 try {
				snumChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			} catch (IOException e) {
				throw new InputMismatchException();
			} IOException e {
				throw new InputMismatchException();
			} throw new InputMismatchException(); new InputMismatchException() {
				snumChars = stream.read(buf);
			} snumChars = stream.read(buf) snumChars stream.read(buf) stream.read stream buf if (snumChars <= 0)
				return -1; snumChars <= 0 snumChars 0 return -1; -1 1 return buf[curChar++]; buf[curChar++] buf curChar++ curChar public int nextInt() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	} nextInt {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	} int c = read(); c read() read while (isSpaceChar(c)) {
			c = read();
		} isSpaceChar(c) isSpaceChar c {
			c = read();
		} c = read() c read() read int sgn = 1; sgn 1 if (c == '-') {
			sgn = -1;
			c = read();
		} c == '-' c '-' {
			sgn = -1;
			c = read();
		} sgn = -1 sgn -1 1 c = read() c read() read int res = 0; res 0 do {
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
			res *= 10;
			res += c - '0';
			c = read();
		} res *= 10 res 10 res += c - '0' res c - '0' c '0' c = read() c read() read return res * sgn; res * sgn res sgn public long nextLong() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	} nextLong {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	} int c = read(); c read() read while (isSpaceChar(c)) {
			c = read();
		} isSpaceChar(c) isSpaceChar c {
			c = read();
		} c = read() c read() read int sgn = 1; sgn 1 if (c == '-') {
			sgn = -1;
			c = read();
		} c == '-' c '-' {
			sgn = -1;
			c = read();
		} sgn = -1 sgn -1 1 c = read() c read() read long res = 0; res 0 do {
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
			res *= 10;
			res += c - '0';
			c = read();
		} res *= 10 res 10 res += c - '0' res c - '0' c '0' c = read() c read() read return res * sgn; res * sgn res sgn public int[] nextIntArray(int n) {
		int a[] = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = nextInt();
		}
		return a;
	} nextIntArray {
		int a[] = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = nextInt();
		}
		return a;
	} int a[] = new int[n]; a new int[n] n for (int i = 0; i < n; i++) {
			a[i] = nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a[i] = nextInt();
		} {
			a[i] = nextInt();
		} a[i] = nextInt() a[i] a i nextInt() nextInt return a; a int n n public String readString() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	} readString {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	} int c = read(); c read() read while (isSpaceChar(c)) {
			c = read();
		} isSpaceChar(c) isSpaceChar c {
			c = read();
		} c = read() c read() read StringBuilder res = new StringBuilder(); res new StringBuilder() do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
			res.appendCodePoint(c);
			c = read();
		} res.appendCodePoint(c) res.appendCodePoint res c c = read() c read() read return res.toString(); res.toString() res.toString res public String nextLine() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isEndOfLine(c));
		return res.toString();
	} nextLine {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isEndOfLine(c));
		return res.toString();
	} int c = read(); c read() read while (isSpaceChar(c))
			c = read(); isSpaceChar(c) isSpaceChar c c = read() c read() read StringBuilder res = new StringBuilder(); res new StringBuilder() do {
			res.appendCodePoint(c);
			c = read();
		} while (!isEndOfLine(c)); !isEndOfLine(c) isEndOfLine(c) isEndOfLine c {
			res.appendCodePoint(c);
			c = read();
		} res.appendCodePoint(c) res.appendCodePoint res c c = read() c read() read return res.toString(); res.toString() res.toString res public boolean isSpaceChar(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	} isSpaceChar {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	} return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1 c == '\t' c == '\r' c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1 c == ' ' c ' ' c == '\n' c '\n' c == '\r' c '\r' c == '\t' c '\t' c == -1 c -1 1 int c c private boolean isEndOfLine(int c) {
		return c == '\n' || c == '\r' || c == -1;
	} isEndOfLine {
		return c == '\n' || c == '\r' || c == -1;
	} return c == '\n' || c == '\r' || c == -1; c == '\n' || c == '\r' || c == -1 c == '\n' || c == '\r' || c == -1 c == '\n' c '\n' c == '\r' c '\r' c == -1 c -1 1 int c c public class Main {
	
	static InputReader in = new InputReader(System.in);
	static PrintWriter out = new PrintWriter(System.out);

	static int MOD = 1000000007;
	static int M = 5005;
	static int oo = (int)1e9;
	
	
	public static void main(String[] args) throws IOException {
		
		char[] ca = in.readString().toCharArray();
		int n = ca.length;
		int[] a = new int[n];
		for(int i=0; i<n; ++i)
			a[i] = ca[i] - '0';
		
//		int[][] dp = new int[n+1][2];
//		for(int i=1; i <= n; ++i) {
//			dp[i][0] = dp[i-1][1] + (c[i-1] == '1' ? 1 : 0);
//			dp[i][1] = dp[i-1][0] + (c[i-1] == '0' ? 1 : 0);
//		}
//		int ans = Math.min( dp[n][0], dp[n][1] );
//		System.out.println(ans);
		
		int cnt1 = 0;
		for(int i=0; i < n; ++i) {
			int x = i % 2;
			if(x != a[i])
				cnt1++;
		}
		int cnt2 = 0;
		for(int i=0; i < n; ++i) {
			int x = 1 - i % 2;
			if(x != a[i])
				cnt2++;
		}
		System.out.println( Math.min(cnt1, cnt2) );
		
		out.close();
	}
	
	
	static void shuffle(int[] a) {
		Random r = new Random();
		for(int i = a.length - 1; i > 0; --i) {
			int si = r.nextInt(i);
			int t = a[si];
			a[si] = a[i];
			a[i] = t;
		}
	}
	
	static int lower_bound(int[] a, int n, int k) {
		int s = 0;
		int e = n;
		int m;
		while (e - s > 0) {
			m = (s + e) / 2;
			if (a[m] < k)
				s = m + 1;
			else
				e = m;
		}
		return e;
	}
	
	static int gcd(int a, int b) {
		return b == 0 ? a : gcd(b, a % b);
	}
	
	static class Pair implements Comparable<Pair> {
		int first, second;

		public Pair(int first, int second) {
			super();
			this.first = first;
			this.second = second;
		}

		@Override
		public int compareTo(Pair o) {
			return this.first != o.first ? this.first - o.first : this.second - o.second;
		}

		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + first;
			result = prime * result + second;
			return result;
		}

		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			Pair other = (Pair) obj;
			if (first != other.first)
				return false;
			if (second != other.second)
				return false;
			return true;
		}
	}
	
	
} public class Main {
	
	static InputReader in = new InputReader(System.in);
	static PrintWriter out = new PrintWriter(System.out);

	static int MOD = 1000000007;
	static int M = 5005;
	static int oo = (int)1e9;
	
	
	public static void main(String[] args) throws IOException {
		
		char[] ca = in.readString().toCharArray();
		int n = ca.length;
		int[] a = new int[n];
		for(int i=0; i<n; ++i)
			a[i] = ca[i] - '0';
		
//		int[][] dp = new int[n+1][2];
//		for(int i=1; i <= n; ++i) {
//			dp[i][0] = dp[i-1][1] + (c[i-1] == '1' ? 1 : 0);
//			dp[i][1] = dp[i-1][0] + (c[i-1] == '0' ? 1 : 0);
//		}
//		int ans = Math.min( dp[n][0], dp[n][1] );
//		System.out.println(ans);
		
		int cnt1 = 0;
		for(int i=0; i < n; ++i) {
			int x = i % 2;
			if(x != a[i])
				cnt1++;
		}
		int cnt2 = 0;
		for(int i=0; i < n; ++i) {
			int x = 1 - i % 2;
			if(x != a[i])
				cnt2++;
		}
		System.out.println( Math.min(cnt1, cnt2) );
		
		out.close();
	}
	
	
	static void shuffle(int[] a) {
		Random r = new Random();
		for(int i = a.length - 1; i > 0; --i) {
			int si = r.nextInt(i);
			int t = a[si];
			a[si] = a[i];
			a[i] = t;
		}
	}
	
	static int lower_bound(int[] a, int n, int k) {
		int s = 0;
		int e = n;
		int m;
		while (e - s > 0) {
			m = (s + e) / 2;
			if (a[m] < k)
				s = m + 1;
			else
				e = m;
		}
		return e;
	}
	
	static int gcd(int a, int b) {
		return b == 0 ? a : gcd(b, a % b);
	}
	
	static class Pair implements Comparable<Pair> {
		int first, second;

		public Pair(int first, int second) {
			super();
			this.first = first;
			this.second = second;
		}

		@Override
		public int compareTo(Pair o) {
			return this.first != o.first ? this.first - o.first : this.second - o.second;
		}

		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + first;
			result = prime * result + second;
			return result;
		}

		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			Pair other = (Pair) obj;
			if (first != other.first)
				return false;
			if (second != other.second)
				return false;
			return true;
		}
	}
	
	
} Main
import java.io.*;
import java.util.*;



public class Main {
	
	static InputReader in = new InputReader(System.in);
	static PrintWriter out = new PrintWriter(System.out);

	static int MOD = 1000000007;
	static int M = 5005;
	static int oo = (int)1e9;
	
	
	public static void main(String[] args) throws IOException {
		
		char[] ca = in.readString().toCharArray();
		int n = ca.length;
		int[] a = new int[n];
		for(int i=0; i<n; ++i)
			a[i] = ca[i] - '0';
		
//		int[][] dp = new int[n+1][2];
//		for(int i=1; i <= n; ++i) {
//			dp[i][0] = dp[i-1][1] + (c[i-1] == '1' ? 1 : 0);
//			dp[i][1] = dp[i-1][0] + (c[i-1] == '0' ? 1 : 0);
//		}
//		int ans = Math.min( dp[n][0], dp[n][1] );
//		System.out.println(ans);
		
		int cnt1 = 0;
		for(int i=0; i < n; ++i) {
			int x = i % 2;
			if(x != a[i])
				cnt1++;
		}
		int cnt2 = 0;
		for(int i=0; i < n; ++i) {
			int x = 1 - i % 2;
			if(x != a[i])
				cnt2++;
		}
		System.out.println( Math.min(cnt1, cnt2) );
		
		out.close();
	}
	
	
	static void shuffle(int[] a) {
		Random r = new Random();
		for(int i = a.length - 1; i > 0; --i) {
			int si = r.nextInt(i);
			int t = a[si];
			a[si] = a[i];
			a[i] = t;
		}
	}
	
	static int lower_bound(int[] a, int n, int k) {
		int s = 0;
		int e = n;
		int m;
		while (e - s > 0) {
			m = (s + e) / 2;
			if (a[m] < k)
				s = m + 1;
			else
				e = m;
		}
		return e;
	}
	
	static int gcd(int a, int b) {
		return b == 0 ? a : gcd(b, a % b);
	}
	
	static class Pair implements Comparable<Pair> {
		int first, second;

		public Pair(int first, int second) {
			super();
			this.first = first;
			this.second = second;
		}

		@Override
		public int compareTo(Pair o) {
			return this.first != o.first ? this.first - o.first : this.second - o.second;
		}

		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + first;
			result = prime * result + second;
			return result;
		}

		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			Pair other = (Pair) obj;
			if (first != other.first)
				return false;
			if (second != other.second)
				return false;
			return true;
		}
	}
	
	
}



class InputReader {

	private final InputStream stream;
	private final byte[] buf = new byte[8192];
	private int curChar, snumChars;

	public InputReader(InputStream st) {
		this.stream = st;
	}

	public int read() {
		if (snumChars == -1)
			throw new InputMismatchException();
		if (curChar >= snumChars) {
			curChar = 0;
			try {
				snumChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (snumChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public int nextInt() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public long nextLong() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public int[] nextIntArray(int n) {
		int a[] = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = nextInt();
		}
		return a;
	}

	public String readString() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	public String nextLine() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isEndOfLine(c));
		return res.toString();
	}

	public boolean isSpaceChar(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	private boolean isEndOfLine(int c) {
		return c == '\n' || c == '\r' || c == -1;
	}

}
