import java.util.Scanner; public class No311 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int sum = 0; int x; x = N/15 * 4; sum += (N/3 - x)*2; sum += (N/5 - x)*2; sum += x * 4; System.out.println(sum); } }