if __name__ == '__main__': n = list(input()) ans = 0 for i in range(0, len(n)): if n[i] == '1' or n[i] == '2' or n[i] == '3' or n[i] == '5' or n[i] == '7': ans += 2 elif n[i] == '0' or n[i] == '4' or n[i] == '6' or n[i] == '9': ans += 3 else: ans += 4 ans += 1 print(ans)