import java.util.Scanner; public class No637_FizzBizz { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int number = scan.nextInt(); int[] list = new int[number]; int count = 0; for (int i = 0; i < list.length; i++) { int value = list[i]; if (value % 3 == 0 && value % 5 == 0) { count = count + 8; } else if (value % 3 == 0 && value % 5 != 0) { count = count + 4; } else if (value % 3 != 0 && value % 5 == 0) { count = count + 4; } else { count = count + String.valueOf(value).length(); } } System.out.println(count); } }