import java.util.*;
import java.math.*;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int[] data = new int[s.length()+1];
    int[] ans = new int[s.length()+1];


    for (int i = 0; i < s.length(); i++) {
      data[i] = Integer.valueOf(s.substring(i,i+1));
      ans[i] = Integer.valueOf(s.substring(i,i+1));
    }

    for (int i = 1; i < s.length()-1; i++) {
      if (data[i-1]== data[i+1]) {
        if (data[i] == data[i+1]) {
          data[i] = Math.abs(data[i]-1);
        }
      } else {
        if (data[i-1] == data[i]) {
          data[i] = Math.abs(data[i]-1);
        } else {
          data[i+1] = Math.abs(data[i+1]-1);
        }
      }
    }

    int count = 0;

    for (int i = 0; i < s.length(); i++) {
      if (data[i] != ans[i]) {
        count++;
      }
    }

    System.out.println(count);

  }

} import java.util.*; util.* java import java.math.*; math.* java public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int[] data = new int[s.length()+1];
    int[] ans = new int[s.length()+1];


    for (int i = 0; i < s.length(); i++) {
      data[i] = Integer.valueOf(s.substring(i,i+1));
      ans[i] = Integer.valueOf(s.substring(i,i+1));
    }

    for (int i = 1; i < s.length()-1; i++) {
      if (data[i-1]== data[i+1]) {
        if (data[i] == data[i+1]) {
          data[i] = Math.abs(data[i]-1);
        }
      } else {
        if (data[i-1] == data[i]) {
          data[i] = Math.abs(data[i]-1);
        } else {
          data[i+1] = Math.abs(data[i+1]-1);
        }
      }
    }

    int count = 0;

    for (int i = 0; i < s.length(); i++) {
      if (data[i] != ans[i]) {
        count++;
      }
    }

    System.out.println(count);

  }

} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int[] data = new int[s.length()+1];
    int[] ans = new int[s.length()+1];


    for (int i = 0; i < s.length(); i++) {
      data[i] = Integer.valueOf(s.substring(i,i+1));
      ans[i] = Integer.valueOf(s.substring(i,i+1));
    }

    for (int i = 1; i < s.length()-1; i++) {
      if (data[i-1]== data[i+1]) {
        if (data[i] == data[i+1]) {
          data[i] = Math.abs(data[i]-1);
        }
      } else {
        if (data[i-1] == data[i]) {
          data[i] = Math.abs(data[i]-1);
        } else {
          data[i+1] = Math.abs(data[i+1]-1);
        }
      }
    }

    int count = 0;

    for (int i = 0; i < s.length(); i++) {
      if (data[i] != ans[i]) {
        count++;
      }
    }

    System.out.println(count);

  } main {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int[] data = new int[s.length()+1];
    int[] ans = new int[s.length()+1];


    for (int i = 0; i < s.length(); i++) {
      data[i] = Integer.valueOf(s.substring(i,i+1));
      ans[i] = Integer.valueOf(s.substring(i,i+1));
    }

    for (int i = 1; i < s.length()-1; i++) {
      if (data[i-1]== data[i+1]) {
        if (data[i] == data[i+1]) {
          data[i] = Math.abs(data[i]-1);
        }
      } else {
        if (data[i-1] == data[i]) {
          data[i] = Math.abs(data[i]-1);
        } else {
          data[i+1] = Math.abs(data[i+1]-1);
        }
      }
    }

    int count = 0;

    for (int i = 0; i < s.length(); i++) {
      if (data[i] != ans[i]) {
        count++;
      }
    }

    System.out.println(count);

  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int[] data = new int[s.length()+1]; data new int[s.length()+1] s.length()+1 s.length() s.length s 1 int[] ans = new int[s.length()+1]; ans new int[s.length()+1] s.length()+1 s.length() s.length s 1 for (int i = 0; i < s.length(); i++) {
      data[i] = Integer.valueOf(s.substring(i,i+1));
      ans[i] = Integer.valueOf(s.substring(i,i+1));
    } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
      data[i] = Integer.valueOf(s.substring(i,i+1));
      ans[i] = Integer.valueOf(s.substring(i,i+1));
    } {
      data[i] = Integer.valueOf(s.substring(i,i+1));
      ans[i] = Integer.valueOf(s.substring(i,i+1));
    } data[i] = Integer.valueOf(s.substring(i,i+1)) data[i] data i Integer.valueOf(s.substring(i,i+1)) Integer.valueOf Integer s.substring(i,i+1) s.substring s i i+1 i 1 ans[i] = Integer.valueOf(s.substring(i,i+1)) ans[i] ans i Integer.valueOf(s.substring(i,i+1)) Integer.valueOf Integer s.substring(i,i+1) s.substring s i i+1 i 1 for (int i = 1; i < s.length()-1; i++) {
      if (data[i-1]== data[i+1]) {
        if (data[i] == data[i+1]) {
          data[i] = Math.abs(data[i]-1);
        }
      } else {
        if (data[i-1] == data[i]) {
          data[i] = Math.abs(data[i]-1);
        } else {
          data[i+1] = Math.abs(data[i+1]-1);
        }
      }
    } int i = 1; int i = 1; i 1 i < s.length()-1 i s.length()-1 s.length() s.length s 1 i++ i++ i {
      if (data[i-1]== data[i+1]) {
        if (data[i] == data[i+1]) {
          data[i] = Math.abs(data[i]-1);
        }
      } else {
        if (data[i-1] == data[i]) {
          data[i] = Math.abs(data[i]-1);
        } else {
          data[i+1] = Math.abs(data[i+1]-1);
        }
      }
    } {
      if (data[i-1]== data[i+1]) {
        if (data[i] == data[i+1]) {
          data[i] = Math.abs(data[i]-1);
        }
      } else {
        if (data[i-1] == data[i]) {
          data[i] = Math.abs(data[i]-1);
        } else {
          data[i+1] = Math.abs(data[i+1]-1);
        }
      }
    } if (data[i-1]== data[i+1]) {
        if (data[i] == data[i+1]) {
          data[i] = Math.abs(data[i]-1);
        }
      } else {
        if (data[i-1] == data[i]) {
          data[i] = Math.abs(data[i]-1);
        } else {
          data[i+1] = Math.abs(data[i+1]-1);
        }
      } data[i-1]== data[i+1] data[i-1] data i-1 i 1 data[i+1] data i+1 i 1 {
        if (data[i] == data[i+1]) {
          data[i] = Math.abs(data[i]-1);
        }
      } if (data[i] == data[i+1]) {
          data[i] = Math.abs(data[i]-1);
        } data[i] == data[i+1] data[i] data i data[i+1] data i+1 i 1 {
          data[i] = Math.abs(data[i]-1);
        } data[i] = Math.abs(data[i]-1) data[i] data i Math.abs(data[i]-1) Math.abs Math data[i]-1 data[i] data i 1 {
        if (data[i-1] == data[i]) {
          data[i] = Math.abs(data[i]-1);
        } else {
          data[i+1] = Math.abs(data[i+1]-1);
        }
      } if (data[i-1] == data[i]) {
          data[i] = Math.abs(data[i]-1);
        } else {
          data[i+1] = Math.abs(data[i+1]-1);
        } data[i-1] == data[i] data[i-1] data i-1 i 1 data[i] data i {
          data[i] = Math.abs(data[i]-1);
        } data[i] = Math.abs(data[i]-1) data[i] data i Math.abs(data[i]-1) Math.abs Math data[i]-1 data[i] data i 1 {
          data[i+1] = Math.abs(data[i+1]-1);
        } data[i+1] = Math.abs(data[i+1]-1) data[i+1] data i+1 i 1 Math.abs(data[i+1]-1) Math.abs Math data[i+1]-1 data[i+1] data i+1 i 1 1 int count = 0; count 0 for (int i = 0; i < s.length(); i++) {
      if (data[i] != ans[i]) {
        count++;
      }
    } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
      if (data[i] != ans[i]) {
        count++;
      }
    } {
      if (data[i] != ans[i]) {
        count++;
      }
    } if (data[i] != ans[i]) {
        count++;
      } data[i] != ans[i] data[i] data i ans[i] ans i {
        count++;
      } count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int[] data = new int[s.length()+1];
    int[] ans = new int[s.length()+1];


    for (int i = 0; i < s.length(); i++) {
      data[i] = Integer.valueOf(s.substring(i,i+1));
      ans[i] = Integer.valueOf(s.substring(i,i+1));
    }

    for (int i = 1; i < s.length()-1; i++) {
      if (data[i-1]== data[i+1]) {
        if (data[i] == data[i+1]) {
          data[i] = Math.abs(data[i]-1);
        }
      } else {
        if (data[i-1] == data[i]) {
          data[i] = Math.abs(data[i]-1);
        } else {
          data[i+1] = Math.abs(data[i+1]-1);
        }
      }
    }

    int count = 0;

    for (int i = 0; i < s.length(); i++) {
      if (data[i] != ans[i]) {
        count++;
      }
    }

    System.out.println(count);

  }

} public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int[] data = new int[s.length()+1];
    int[] ans = new int[s.length()+1];


    for (int i = 0; i < s.length(); i++) {
      data[i] = Integer.valueOf(s.substring(i,i+1));
      ans[i] = Integer.valueOf(s.substring(i,i+1));
    }

    for (int i = 1; i < s.length()-1; i++) {
      if (data[i-1]== data[i+1]) {
        if (data[i] == data[i+1]) {
          data[i] = Math.abs(data[i]-1);
        }
      } else {
        if (data[i-1] == data[i]) {
          data[i] = Math.abs(data[i]-1);
        } else {
          data[i+1] = Math.abs(data[i+1]-1);
        }
      }
    }

    int count = 0;

    for (int i = 0; i < s.length(); i++) {
      if (data[i] != ans[i]) {
        count++;
      }
    }

    System.out.println(count);

  }

} Main
import java.util.*;
import java.math.*;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int[] data = new int[s.length()+1];
    int[] ans = new int[s.length()+1];


    for (int i = 0; i < s.length(); i++) {
      data[i] = Integer.valueOf(s.substring(i,i+1));
      ans[i] = Integer.valueOf(s.substring(i,i+1));
    }

    for (int i = 1; i < s.length()-1; i++) {
      if (data[i-1]== data[i+1]) {
        if (data[i] == data[i+1]) {
          data[i] = Math.abs(data[i]-1);
        }
      } else {
        if (data[i-1] == data[i]) {
          data[i] = Math.abs(data[i]-1);
        } else {
          data[i+1] = Math.abs(data[i+1]-1);
        }
      }
    }

    int count = 0;

    for (int i = 0; i < s.length(); i++) {
      if (data[i] != ans[i]) {
        count++;
      }
    }

    System.out.println(count);

  }

}
