// No.671 1000000007 package main import ( "fmt" "strings" ) var x int = strings.Count("1000000007", "0") func main() { var n string fmt.Scan(&n) y := strings.Count(n, "0") fmt.Println(max(x-y, y-x)) }