import java.awt.Polygon;
import java.awt.geom.Area;
import java.awt.geom.PathIterator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) throws Exception
	{
		new Main().run();
	}
	
	public void run() throws Exception
	{
		Scanner file = new Scanner(System.in);
		char[] chars = file.next().toCharArray();
		int len = chars.length;
		int c1 = 0;
		int c2 = 0;
		for(int i = 0;i<len;i++)
		{
			if(i%2==0 ^ chars[i] == '0')
				c1++;
			else
				c2++;
		}
		System.out.println(Math.min(c1, c2));
	}
} import java.awt.Polygon; Polygon java.awt import java.awt.geom.Area; Area java.awt.geom import java.awt.geom.PathIterator; PathIterator java.awt.geom import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	
	public static void main(String[] args) throws Exception
	{
		new Main().run();
	}
	
	public void run() throws Exception
	{
		Scanner file = new Scanner(System.in);
		char[] chars = file.next().toCharArray();
		int len = chars.length;
		int c1 = 0;
		int c2 = 0;
		for(int i = 0;i<len;i++)
		{
			if(i%2==0 ^ chars[i] == '0')
				c1++;
			else
				c2++;
		}
		System.out.println(Math.min(c1, c2));
	}
} Main public static void main(String[] args) throws Exception
	{
		new Main().run();
	} main {
		new Main().run();
	} new Main().run() new Main().run new Main() String[] args args public void run() throws Exception
	{
		Scanner file = new Scanner(System.in);
		char[] chars = file.next().toCharArray();
		int len = chars.length;
		int c1 = 0;
		int c2 = 0;
		for(int i = 0;i<len;i++)
		{
			if(i%2==0 ^ chars[i] == '0')
				c1++;
			else
				c2++;
		}
		System.out.println(Math.min(c1, c2));
	} run {
		Scanner file = new Scanner(System.in);
		char[] chars = file.next().toCharArray();
		int len = chars.length;
		int c1 = 0;
		int c2 = 0;
		for(int i = 0;i<len;i++)
		{
			if(i%2==0 ^ chars[i] == '0')
				c1++;
			else
				c2++;
		}
		System.out.println(Math.min(c1, c2));
	} Scanner file = new Scanner(System.in); file new Scanner(System.in) char[] chars = file.next().toCharArray(); chars file.next().toCharArray() file.next().toCharArray file.next() file.next file int len = chars.length; len chars.length chars chars.length int c1 = 0; c1 0 int c2 = 0; c2 0 for(int i = 0;i<len;i++)
		{
			if(i%2==0 ^ chars[i] == '0')
				c1++;
			else
				c2++;
		} int i = 0; int i = 0; i 0 i<len i len i++ i++ i {
			if(i%2==0 ^ chars[i] == '0')
				c1++;
			else
				c2++;
		} {
			if(i%2==0 ^ chars[i] == '0')
				c1++;
			else
				c2++;
		} if(i%2==0 ^ chars[i] == '0')
				c1++;
			else
				c2++; i%2==0 ^ chars[i] == '0' i%2==0 i%2 i 2 0 chars[i] == '0' chars[i] chars i '0' c1++ c1 c2++ c2 System.out.println(Math.min(c1, c2)) System.out.println System.out System System.out Math.min(c1, c2) Math.min Math c1 c2 public class Main {
	
	public static void main(String[] args) throws Exception
	{
		new Main().run();
	}
	
	public void run() throws Exception
	{
		Scanner file = new Scanner(System.in);
		char[] chars = file.next().toCharArray();
		int len = chars.length;
		int c1 = 0;
		int c2 = 0;
		for(int i = 0;i<len;i++)
		{
			if(i%2==0 ^ chars[i] == '0')
				c1++;
			else
				c2++;
		}
		System.out.println(Math.min(c1, c2));
	}
} public class Main {
	
	public static void main(String[] args) throws Exception
	{
		new Main().run();
	}
	
	public void run() throws Exception
	{
		Scanner file = new Scanner(System.in);
		char[] chars = file.next().toCharArray();
		int len = chars.length;
		int c1 = 0;
		int c2 = 0;
		for(int i = 0;i<len;i++)
		{
			if(i%2==0 ^ chars[i] == '0')
				c1++;
			else
				c2++;
		}
		System.out.println(Math.min(c1, c2));
	}
} Main
import java.awt.Polygon;
import java.awt.geom.Area;
import java.awt.geom.PathIterator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) throws Exception
	{
		new Main().run();
	}
	
	public void run() throws Exception
	{
		Scanner file = new Scanner(System.in);
		char[] chars = file.next().toCharArray();
		int len = chars.length;
		int c1 = 0;
		int c2 = 0;
		for(int i = 0;i<len;i++)
		{
			if(i%2==0 ^ chars[i] == '0')
				c1++;
			else
				c2++;
		}
		System.out.println(Math.min(c1, c2));
	}
}
