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; while (s.hasNext()) { 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 { count = count + 1; } } System.out.println(count); } }