# Predefined fill counts for each digit from 0 to 9 fill_counts = [2, 3, 3, 3, 4, 3, 4, 3, 2, 3] n = input().strip() total = 0 for c in n: total += fill_counts[int(c)] print(total)