n = input() cnt = n.count("0") ans = abs(cnt - 8) print(ans)