

import java.util.Scanner;

public class Main {
public static void main(String args[])
{
	Scanner scan=new Scanner(System.in);
	String g=scan.next();
	int start=0;
	long sum=0;
	for(int i=0;i<g.length();i++)
	{
		sum+=Math.abs((g.charAt(i)-'0')-start);
		start=1-start;
	}
	long sum2=0;
	start=1;
	for(int i=0;i<g.length();i++)
	{
		sum2+=Math.abs((g.charAt(i)-'0')-start);
		start=1-start;
	}
	System.out.println(Math.min(sum, sum2));
	
}
} import java.util.Scanner; Scanner java.util public class Main {
public static void main(String args[])
{
	Scanner scan=new Scanner(System.in);
	String g=scan.next();
	int start=0;
	long sum=0;
	for(int i=0;i<g.length();i++)
	{
		sum+=Math.abs((g.charAt(i)-'0')-start);
		start=1-start;
	}
	long sum2=0;
	start=1;
	for(int i=0;i<g.length();i++)
	{
		sum2+=Math.abs((g.charAt(i)-'0')-start);
		start=1-start;
	}
	System.out.println(Math.min(sum, sum2));
	
}
} Main public static void main(String args[])
{
	Scanner scan=new Scanner(System.in);
	String g=scan.next();
	int start=0;
	long sum=0;
	for(int i=0;i<g.length();i++)
	{
		sum+=Math.abs((g.charAt(i)-'0')-start);
		start=1-start;
	}
	long sum2=0;
	start=1;
	for(int i=0;i<g.length();i++)
	{
		sum2+=Math.abs((g.charAt(i)-'0')-start);
		start=1-start;
	}
	System.out.println(Math.min(sum, sum2));
	
} main {
	Scanner scan=new Scanner(System.in);
	String g=scan.next();
	int start=0;
	long sum=0;
	for(int i=0;i<g.length();i++)
	{
		sum+=Math.abs((g.charAt(i)-'0')-start);
		start=1-start;
	}
	long sum2=0;
	start=1;
	for(int i=0;i<g.length();i++)
	{
		sum2+=Math.abs((g.charAt(i)-'0')-start);
		start=1-start;
	}
	System.out.println(Math.min(sum, sum2));
	
} Scanner scan=new Scanner(System.in); scan new Scanner(System.in) String g=scan.next(); g scan.next() scan.next scan int start=0; start 0 long sum=0; sum 0 for(int i=0;i<g.length();i++)
	{
		sum+=Math.abs((g.charAt(i)-'0')-start);
		start=1-start;
	} int i=0; int i=0; i 0 i<g.length() i g.length() g.length g i++ i++ i {
		sum+=Math.abs((g.charAt(i)-'0')-start);
		start=1-start;
	} {
		sum+=Math.abs((g.charAt(i)-'0')-start);
		start=1-start;
	} sum+=Math.abs((g.charAt(i)-'0')-start) sum Math.abs((g.charAt(i)-'0')-start) Math.abs Math (g.charAt(i)-'0')-start (g.charAt(i)-'0') g.charAt(i) g.charAt g i '0' start start=1-start start 1-start 1 start long sum2=0; sum2 0 start=1 start 1 for(int i=0;i<g.length();i++)
	{
		sum2+=Math.abs((g.charAt(i)-'0')-start);
		start=1-start;
	} int i=0; int i=0; i 0 i<g.length() i g.length() g.length g i++ i++ i {
		sum2+=Math.abs((g.charAt(i)-'0')-start);
		start=1-start;
	} {
		sum2+=Math.abs((g.charAt(i)-'0')-start);
		start=1-start;
	} sum2+=Math.abs((g.charAt(i)-'0')-start) sum2 Math.abs((g.charAt(i)-'0')-start) Math.abs Math (g.charAt(i)-'0')-start (g.charAt(i)-'0') g.charAt(i) g.charAt g i '0' start start=1-start start 1-start 1 start System.out.println(Math.min(sum, sum2)) System.out.println System.out System System.out Math.min(sum, sum2) Math.min Math sum sum2 String args[] args public class Main {
public static void main(String args[])
{
	Scanner scan=new Scanner(System.in);
	String g=scan.next();
	int start=0;
	long sum=0;
	for(int i=0;i<g.length();i++)
	{
		sum+=Math.abs((g.charAt(i)-'0')-start);
		start=1-start;
	}
	long sum2=0;
	start=1;
	for(int i=0;i<g.length();i++)
	{
		sum2+=Math.abs((g.charAt(i)-'0')-start);
		start=1-start;
	}
	System.out.println(Math.min(sum, sum2));
	
}
} public class Main {
public static void main(String args[])
{
	Scanner scan=new Scanner(System.in);
	String g=scan.next();
	int start=0;
	long sum=0;
	for(int i=0;i<g.length();i++)
	{
		sum+=Math.abs((g.charAt(i)-'0')-start);
		start=1-start;
	}
	long sum2=0;
	start=1;
	for(int i=0;i<g.length();i++)
	{
		sum2+=Math.abs((g.charAt(i)-'0')-start);
		start=1-start;
	}
	System.out.println(Math.min(sum, sum2));
	
}
} Main


import java.util.Scanner;

public class Main {
public static void main(String args[])
{
	Scanner scan=new Scanner(System.in);
	String g=scan.next();
	int start=0;
	long sum=0;
	for(int i=0;i<g.length();i++)
	{
		sum+=Math.abs((g.charAt(i)-'0')-start);
		start=1-start;
	}
	long sum2=0;
	start=1;
	for(int i=0;i<g.length();i++)
	{
		sum2+=Math.abs((g.charAt(i)-'0')-start);
		start=1-start;
	}
	System.out.println(Math.min(sum, sum2));
	
}
}
