N = list(input()) a = N.count("0") print(abs(a-8))