# Predefined fill counts for each digit based on their connected components + background fill_counts = { '0': 2, '1': 3, '2': 3, '3': 3, '4': 4, '5': 3, '6': 4, '7': 3, '8': 2, '9': 3, } n = input().strip() total = sum(fill_counts[c] for c in n) print(total)