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; int N = s.nextInt(); for (int i = 1; i < N + 1; i++) { if (i % 3 == 0 && i % 5 == 0) { count = count + 4; } else if (i % 3 == 0 || i % 5 == 0) { count = count + 2; } } System.out.println(count); } }