package com.company; import java.util.Scanner; public class Main { public static void main(String[] args) { // write your code here Scanner s = new Scanner(System.in); int count = 0; for (int i = 0; i < 5; i++) { int n = s.nextInt(); if (n % 3 == 0 && n % 5 == 0) { count = count + 8; } else if (n % 3 == 0 || n % 5 == 0) { count = count + 4; } else { int loop = 1; while (n >= 10) { n = n / 10; loop++; } count = count + loop; } } System.out.println(count); } }