import java.util.*;
public class Main
{
  public static void main(String[] args)
  {
    Scanner in = new Scanner(System.in);
    char[] c = in.next().toCharArray();
    char[] eq = {'0', '1'};
    int o = 0, z = 0;
    for (int i = 0; i < c.length; i++)
    {
      if (c[i] != eq[i%2]) o++;
      else z++;
    }
    int ans = (int)(Math.min(o, z));
    System.out.println(ans);
  }
} import java.util.*; util.* java public class Main
{
  public static void main(String[] args)
  {
    Scanner in = new Scanner(System.in);
    char[] c = in.next().toCharArray();
    char[] eq = {'0', '1'};
    int o = 0, z = 0;
    for (int i = 0; i < c.length; i++)
    {
      if (c[i] != eq[i%2]) o++;
      else z++;
    }
    int ans = (int)(Math.min(o, z));
    System.out.println(ans);
  }
} Main public static void main(String[] args)
  {
    Scanner in = new Scanner(System.in);
    char[] c = in.next().toCharArray();
    char[] eq = {'0', '1'};
    int o = 0, z = 0;
    for (int i = 0; i < c.length; i++)
    {
      if (c[i] != eq[i%2]) o++;
      else z++;
    }
    int ans = (int)(Math.min(o, z));
    System.out.println(ans);
  } main {
    Scanner in = new Scanner(System.in);
    char[] c = in.next().toCharArray();
    char[] eq = {'0', '1'};
    int o = 0, z = 0;
    for (int i = 0; i < c.length; i++)
    {
      if (c[i] != eq[i%2]) o++;
      else z++;
    }
    int ans = (int)(Math.min(o, z));
    System.out.println(ans);
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) char[] c = in.next().toCharArray(); c in.next().toCharArray() in.next().toCharArray in.next() in.next in char[] eq = {'0', '1'}; eq {'0', '1'} '0' '1' int o = 0 o 0 z = 0; z 0 for (int i = 0; i < c.length; i++)
    {
      if (c[i] != eq[i%2]) o++;
      else z++;
    } int i = 0; int i = 0; i 0 i < c.length i c.length c c.length i++ i++ i {
      if (c[i] != eq[i%2]) o++;
      else z++;
    } {
      if (c[i] != eq[i%2]) o++;
      else z++;
    } if (c[i] != eq[i%2]) o++;
      else z++; c[i] != eq[i%2] c[i] c i eq[i%2] eq i%2 i 2 o++ o z++ z int ans = (int)(Math.min(o, z)); ans (int)(Math.min(o, z)) Math.min Math o z System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main
{
  public static void main(String[] args)
  {
    Scanner in = new Scanner(System.in);
    char[] c = in.next().toCharArray();
    char[] eq = {'0', '1'};
    int o = 0, z = 0;
    for (int i = 0; i < c.length; i++)
    {
      if (c[i] != eq[i%2]) o++;
      else z++;
    }
    int ans = (int)(Math.min(o, z));
    System.out.println(ans);
  }
} public class Main
{
  public static void main(String[] args)
  {
    Scanner in = new Scanner(System.in);
    char[] c = in.next().toCharArray();
    char[] eq = {'0', '1'};
    int o = 0, z = 0;
    for (int i = 0; i < c.length; i++)
    {
      if (c[i] != eq[i%2]) o++;
      else z++;
    }
    int ans = (int)(Math.min(o, z));
    System.out.println(ans);
  }
} Main
import java.util.*;
public class Main
{
  public static void main(String[] args)
  {
    Scanner in = new Scanner(System.in);
    char[] c = in.next().toCharArray();
    char[] eq = {'0', '1'};
    int o = 0, z = 0;
    for (int i = 0; i < c.length; i++)
    {
      if (c[i] != eq[i%2]) o++;
      else z++;
    }
    int ans = (int)(Math.min(o, z));
    System.out.println(ans);
  }
}