import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    String s = sc.next();

    String[] sList = s.split("");

    int[] intList = new int[s.length()];
    for(int i = 0;i < s.length(); i++){
      intList[i] = Integer.parseInt(sList[i]);
    }

    int startBlack = 0;
    int startWhite = 0;

    if(intList[0] == 0) {
      int next = 0;
      for (int i = 0; i < s.length(); i++) {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;

          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      }
    } else if (intList[0] == 1) {
      int next = 1;
      for (int i = 0; i < s.length(); i++) {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      }
    }

    if(startBlack > startWhite) {
      System.out.println(startBlack);
    } else if (startWhite > startBlack) {
      System.out.println(startWhite);
    } else {
      System.out.println(startBlack);
    }

  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    String s = sc.next();

    String[] sList = s.split("");

    int[] intList = new int[s.length()];
    for(int i = 0;i < s.length(); i++){
      intList[i] = Integer.parseInt(sList[i]);
    }

    int startBlack = 0;
    int startWhite = 0;

    if(intList[0] == 0) {
      int next = 0;
      for (int i = 0; i < s.length(); i++) {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;

          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      }
    } else if (intList[0] == 1) {
      int next = 1;
      for (int i = 0; i < s.length(); i++) {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      }
    }

    if(startBlack > startWhite) {
      System.out.println(startBlack);
    } else if (startWhite > startBlack) {
      System.out.println(startWhite);
    } else {
      System.out.println(startBlack);
    }

  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    String s = sc.next();

    String[] sList = s.split("");

    int[] intList = new int[s.length()];
    for(int i = 0;i < s.length(); i++){
      intList[i] = Integer.parseInt(sList[i]);
    }

    int startBlack = 0;
    int startWhite = 0;

    if(intList[0] == 0) {
      int next = 0;
      for (int i = 0; i < s.length(); i++) {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;

          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      }
    } else if (intList[0] == 1) {
      int next = 1;
      for (int i = 0; i < s.length(); i++) {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      }
    }

    if(startBlack > startWhite) {
      System.out.println(startBlack);
    } else if (startWhite > startBlack) {
      System.out.println(startWhite);
    } else {
      System.out.println(startBlack);
    }

  } main {
    Scanner sc = new Scanner(System.in);

    String s = sc.next();

    String[] sList = s.split("");

    int[] intList = new int[s.length()];
    for(int i = 0;i < s.length(); i++){
      intList[i] = Integer.parseInt(sList[i]);
    }

    int startBlack = 0;
    int startWhite = 0;

    if(intList[0] == 0) {
      int next = 0;
      for (int i = 0; i < s.length(); i++) {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;

          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      }
    } else if (intList[0] == 1) {
      int next = 1;
      for (int i = 0; i < s.length(); i++) {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      }
    }

    if(startBlack > startWhite) {
      System.out.println(startBlack);
    } else if (startWhite > startBlack) {
      System.out.println(startWhite);
    } else {
      System.out.println(startBlack);
    }

  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc String[] sList = s.split(""); sList s.split("") s.split s "" int[] intList = new int[s.length()]; intList new int[s.length()] s.length() s.length s for(int i = 0;i < s.length(); i++){
      intList[i] = Integer.parseInt(sList[i]);
    } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
      intList[i] = Integer.parseInt(sList[i]);
    } {
      intList[i] = Integer.parseInt(sList[i]);
    } intList[i] = Integer.parseInt(sList[i]) intList[i] intList i Integer.parseInt(sList[i]) Integer.parseInt Integer sList[i] sList i int startBlack = 0; startBlack 0 int startWhite = 0; startWhite 0 if(intList[0] == 0) {
      int next = 0;
      for (int i = 0; i < s.length(); i++) {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;

          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      }
    } else if (intList[0] == 1) {
      int next = 1;
      for (int i = 0; i < s.length(); i++) {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      }
    } intList[0] == 0 intList[0] intList 0 0 {
      int next = 0;
      for (int i = 0; i < s.length(); i++) {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;

          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      }
    } int next = 0; next 0 for (int i = 0; i < s.length(); i++) {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;

          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;

          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      } {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;

          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      } if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;

          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } intList[i] == next intList[i] intList i next {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          } next == 0 next 0 {
            next = 1;
          } next = 1 next 1 if (next == 1) {
            next = 0;
          } next == 1 next 1 {
            next = 0;
          } next = 0 next 0 {

          startBlack++;

          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } startBlack++ startBlack if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          } next == 0 next 0 {
            next = 1;
          } next = 1 next 1 if (next == 1) {
            next = 0;
          } next == 1 next 1 {
            next = 0;
          } next = 0 next 0 if (intList[0] == 1) {
      int next = 1;
      for (int i = 0; i < s.length(); i++) {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      }
    } intList[0] == 1 intList[0] intList 0 1 {
      int next = 1;
      for (int i = 0; i < s.length(); i++) {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      }
    } int next = 1; next 1 for (int i = 0; i < s.length(); i++) {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      } {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      } if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } intList[i] == next intList[i] intList i next {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          } next == 0 next 0 {
            next = 1;
          } next = 1 next 1 if (next == 1) {
            next = 0;
          } next == 1 next 1 {
            next = 0;
          } next = 0 next 0 {

          startBlack++;
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } startBlack++ startBlack if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          } next == 0 next 0 {
            next = 1;
          } next = 1 next 1 if (next == 1) {
            next = 0;
          } next == 1 next 1 {
            next = 0;
          } next = 0 next 0 if(startBlack > startWhite) {
      System.out.println(startBlack);
    } else if (startWhite > startBlack) {
      System.out.println(startWhite);
    } else {
      System.out.println(startBlack);
    } startBlack > startWhite startBlack startWhite {
      System.out.println(startBlack);
    } System.out.println(startBlack) System.out.println System.out System System.out startBlack if (startWhite > startBlack) {
      System.out.println(startWhite);
    } else {
      System.out.println(startBlack);
    } startWhite > startBlack startWhite startBlack {
      System.out.println(startWhite);
    } System.out.println(startWhite) System.out.println System.out System System.out startWhite {
      System.out.println(startBlack);
    } System.out.println(startBlack) System.out.println System.out System System.out startBlack String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    String s = sc.next();

    String[] sList = s.split("");

    int[] intList = new int[s.length()];
    for(int i = 0;i < s.length(); i++){
      intList[i] = Integer.parseInt(sList[i]);
    }

    int startBlack = 0;
    int startWhite = 0;

    if(intList[0] == 0) {
      int next = 0;
      for (int i = 0; i < s.length(); i++) {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;

          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      }
    } else if (intList[0] == 1) {
      int next = 1;
      for (int i = 0; i < s.length(); i++) {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      }
    }

    if(startBlack > startWhite) {
      System.out.println(startBlack);
    } else if (startWhite > startBlack) {
      System.out.println(startWhite);
    } else {
      System.out.println(startBlack);
    }

  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    String s = sc.next();

    String[] sList = s.split("");

    int[] intList = new int[s.length()];
    for(int i = 0;i < s.length(); i++){
      intList[i] = Integer.parseInt(sList[i]);
    }

    int startBlack = 0;
    int startWhite = 0;

    if(intList[0] == 0) {
      int next = 0;
      for (int i = 0; i < s.length(); i++) {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;

          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      }
    } else if (intList[0] == 1) {
      int next = 1;
      for (int i = 0; i < s.length(); i++) {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      }
    }

    if(startBlack > startWhite) {
      System.out.println(startBlack);
    } else if (startWhite > startBlack) {
      System.out.println(startWhite);
    } else {
      System.out.println(startBlack);
    }

  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    String s = sc.next();

    String[] sList = s.split("");

    int[] intList = new int[s.length()];
    for(int i = 0;i < s.length(); i++){
      intList[i] = Integer.parseInt(sList[i]);
    }

    int startBlack = 0;
    int startWhite = 0;

    if(intList[0] == 0) {
      int next = 0;
      for (int i = 0; i < s.length(); i++) {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;

          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      }
    } else if (intList[0] == 1) {
      int next = 1;
      for (int i = 0; i < s.length(); i++) {
        if(intList[i] == next) {
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        } else {

          startBlack++;
          if(next == 0) {
            next = 1;
          } else if (next == 1) {
            next = 0;
          }
        }
      }
    }

    if(startBlack > startWhite) {
      System.out.println(startBlack);
    } else if (startWhite > startBlack) {
      System.out.println(startWhite);
    } else {
      System.out.println(startBlack);
    }

  }
}
