import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    String X;
    String Y;
    int c0 = 0;
    int c1 = 0;
    
    for(int i=0; i< S.length(); i++) {
      if(i%2 == 0) {
        X = "0";
        Y = "1";
      } else {
        X = "1";
        Y = "0";
      }
      if(!S.substring(i, i+1).equals(X)) {
        c0++;
      } else {
        c1++;
      }
    }
    if(c0<c1) {
      System.out.println(c0);
    } else {
      System.out.println(c1);
    }
  }
} 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 X;
    String Y;
    int c0 = 0;
    int c1 = 0;
    
    for(int i=0; i< S.length(); i++) {
      if(i%2 == 0) {
        X = "0";
        Y = "1";
      } else {
        X = "1";
        Y = "0";
      }
      if(!S.substring(i, i+1).equals(X)) {
        c0++;
      } else {
        c1++;
      }
    }
    if(c0<c1) {
      System.out.println(c0);
    } else {
      System.out.println(c1);
    }
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    String X;
    String Y;
    int c0 = 0;
    int c1 = 0;
    
    for(int i=0; i< S.length(); i++) {
      if(i%2 == 0) {
        X = "0";
        Y = "1";
      } else {
        X = "1";
        Y = "0";
      }
      if(!S.substring(i, i+1).equals(X)) {
        c0++;
      } else {
        c1++;
      }
    }
    if(c0<c1) {
      System.out.println(c0);
    } else {
      System.out.println(c1);
    }
  } main {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    String X;
    String Y;
    int c0 = 0;
    int c1 = 0;
    
    for(int i=0; i< S.length(); i++) {
      if(i%2 == 0) {
        X = "0";
        Y = "1";
      } else {
        X = "1";
        Y = "0";
      }
      if(!S.substring(i, i+1).equals(X)) {
        c0++;
      } else {
        c1++;
      }
    }
    if(c0<c1) {
      System.out.println(c0);
    } else {
      System.out.println(c1);
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc String X; X String Y; Y int c0 = 0; c0 0 int c1 = 0; c1 0 for(int i=0; i< S.length(); i++) {
      if(i%2 == 0) {
        X = "0";
        Y = "1";
      } else {
        X = "1";
        Y = "0";
      }
      if(!S.substring(i, i+1).equals(X)) {
        c0++;
      } else {
        c1++;
      }
    } int i=0; int i=0; i 0 i< S.length() i S.length() S.length S i++ i++ i {
      if(i%2 == 0) {
        X = "0";
        Y = "1";
      } else {
        X = "1";
        Y = "0";
      }
      if(!S.substring(i, i+1).equals(X)) {
        c0++;
      } else {
        c1++;
      }
    } {
      if(i%2 == 0) {
        X = "0";
        Y = "1";
      } else {
        X = "1";
        Y = "0";
      }
      if(!S.substring(i, i+1).equals(X)) {
        c0++;
      } else {
        c1++;
      }
    } if(i%2 == 0) {
        X = "0";
        Y = "1";
      } else {
        X = "1";
        Y = "0";
      } i%2 == 0 i%2 i 2 0 {
        X = "0";
        Y = "1";
      } X = "0" X "0" Y = "1" Y "1" {
        X = "1";
        Y = "0";
      } X = "1" X "1" Y = "0" Y "0" if(!S.substring(i, i+1).equals(X)) {
        c0++;
      } else {
        c1++;
      } !S.substring(i, i+1).equals(X) S.substring(i, i+1).equals(X) S.substring(i, i+1).equals S.substring(i, i+1) S.substring S i i+1 i 1 X {
        c0++;
      } c0++ c0 {
        c1++;
      } c1++ c1 if(c0<c1) {
      System.out.println(c0);
    } else {
      System.out.println(c1);
    } c0<c1 c0 c1 {
      System.out.println(c0);
    } System.out.println(c0) System.out.println System.out System System.out c0 {
      System.out.println(c1);
    } System.out.println(c1) System.out.println System.out System System.out c1 String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    String X;
    String Y;
    int c0 = 0;
    int c1 = 0;
    
    for(int i=0; i< S.length(); i++) {
      if(i%2 == 0) {
        X = "0";
        Y = "1";
      } else {
        X = "1";
        Y = "0";
      }
      if(!S.substring(i, i+1).equals(X)) {
        c0++;
      } else {
        c1++;
      }
    }
    if(c0<c1) {
      System.out.println(c0);
    } else {
      System.out.println(c1);
    }
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    String X;
    String Y;
    int c0 = 0;
    int c1 = 0;
    
    for(int i=0; i< S.length(); i++) {
      if(i%2 == 0) {
        X = "0";
        Y = "1";
      } else {
        X = "1";
        Y = "0";
      }
      if(!S.substring(i, i+1).equals(X)) {
        c0++;
      } else {
        c1++;
      }
    }
    if(c0<c1) {
      System.out.println(c0);
    } else {
      System.out.println(c1);
    }
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    String X;
    String Y;
    int c0 = 0;
    int c1 = 0;
    
    for(int i=0; i< S.length(); i++) {
      if(i%2 == 0) {
        X = "0";
        Y = "1";
      } else {
        X = "1";
        Y = "0";
      }
      if(!S.substring(i, i+1).equals(X)) {
        c0++;
      } else {
        c1++;
      }
    }
    if(c0<c1) {
      System.out.println(c0);
    } else {
      System.out.println(c1);
    }
  }
}