using static System.Console; using System.Linq; namespace App { class Prog { static void Main() { var x = ReadLine().Split().Select(int.Parse).ToArray(); int count = 0; for (int i = 0; i < x.Length; i++) { if (x[i] % 3 != 0 && x[i] % 5 != 0) { count += x[i].ToString().Length; continue; } if (x[i] % 3 == 0) count += 4; if (x[i] % 5 == 0) count += 4; } WriteLine(count); } } }