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