using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; class Program { static void Main(string[] args) { var a = Console.ReadLine().Split().Select(int.Parse); int ans = 0; foreach (var item in a) { if (item % 15 == 0) { ans += 8; } else if (item % 5 == 0) { ans += 4; } else if (item % 3 == 0) { ans += 4; } else { ans += (int)Math.Log(item, 10) + 1; } } Console.WriteLine(ans); } }