s = input() total = 1 for c in s: if c in ("0", "4", "6", "9"): total += 3 elif c == "8": total += 4 else: total += 2 print(total)