# Define the precomputed values for each digit (B + W)
digit_fills = {
    '0': 2,
    '1': 2,
    '2': 1,
    '3': 1,
    '4': 4,
    '5': 1,
    '6': 3,
    '7': 2,
    '8': 5,
    '9': 3,
}

n = input().strip()
if not n:  # Handle edge case where input might be empty (though n >=0)
    print(1)
else:
    total = sum(digit_fills[c] for c in n)
    print(total + 1)