using System; namespace yukicoder { class Program { static void Main(string[] args) { int[] p = { 1, 0, 0, 0, 1, 0, 1, 0, 2, 1 }; string n = Console.ReadLine(); int l = n.Length; int ans = 1 + 2 * l; for (int i = 0; i < l; i++) { ans += p[n[i] - '0']; } Console.WriteLine(ans); } } }