import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int ans; int a; int b; int c; a = n / 15; b = n / 5; c = n / 3; if(a == 0){ ans = 2 * (b + c); }else{ ans = 4 * a + 2 * ((b - b / 3) + (c - c / 5)); } System.out.println(ans); } }