package yukicoder.No637; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int cnt = 0; for (int i = 0; i < 5; i++) { int num = in.nextInt(); if (num%3 == 0 && num%5 == 0) { cnt += 8; } else if (num%3 == 0 && num%5 != 0) { cnt += 4; } else if (num%5 == 0 && num%3 != 0) { cnt += 4; } else if (num%3 != 0 && num%5 != 0) { cnt += Integer.toString(num).length(); } } System.out.println(cnt); } }