#!/bin/bash

read in1
a=(`echo $in1 | fold -1`)
p=${#in1}
i=0

n=0
if [ ${in1:0:1} -eq 1 ]; then
  let ++i
fi
while [ $p -ne 0 ]; do
  if [ ${in1:0:1} -ne $((i%2)) ]; then
    let ++n
  fi
  let ++i
  let --p
  in1=${in1:1}
done
echo $n