import java.util.*; public class Main { public static void main(String[] args) { // 標準入力を受け取る Scanner sc = new Scanner(System.in); Long n = sc.nextLong(); int result = 0; for(long l = 1; l <= n; l++) { if(l % 15 == 0) { result += 4; }else if(l % 3 == 0) { result += 2; }else if(l % 5 == 0) { result += 2; } } System.out.println(result); } }