import java.io.*;

public class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        long N = Long.parseLong (reader.readLine());
        System.out.println (calc (1, N) - calc (3, N) - calc (5, N) +
                            calc (15, N));
        return;
    }

    static long calc (long n, long N) {
        return (n + N / n * n) * (N / n) / 2;
    }
} import java.io.*; io.* java public class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        long N = Long.parseLong (reader.readLine());
        System.out.println (calc (1, N) - calc (3, N) - calc (5, N) +
                            calc (15, N));
        return;
    }

    static long calc (long n, long N) {
        return (n + N / n * n) * (N / n) / 2;
    }
} Main public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        long N = Long.parseLong (reader.readLine());
        System.out.println (calc (1, N) - calc (3, N) - calc (5, N) +
                            calc (15, N));
        return;
    } main {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        long N = Long.parseLong (reader.readLine());
        System.out.println (calc (1, N) - calc (3, N) - calc (5, N) +
                            calc (15, N));
        return;
    } BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in)); reader new BufferedReader (new InputStreamReader (System.in)) long N = Long.parseLong (reader.readLine()); N Long.parseLong (reader.readLine()) Long.parseLong Long reader.readLine() reader.readLine reader System.out.println (calc (1, N) - calc (3, N) - calc (5, N) +
                            calc (15, N)) System.out.println System.out System System.out calc (1, N) - calc (3, N) - calc (5, N) +
                            calc (15, N) calc (1, N) - calc (3, N) - calc (5, N) calc (1, N) - calc (3, N) - calc (5, N) calc (1, N) calc 1 N calc (3, N) calc 3 N calc (5, N) calc 5 N calc (15, N) calc 15 N return; String[] args args static long calc (long n, long N) {
        return (n + N / n * n) * (N / n) / 2;
    } calc {
        return (n + N / n * n) * (N / n) / 2;
    } return (n + N / n * n) * (N / n) / 2; (n + N / n * n) * (N / n) / 2 (n + N / n * n) * (N / n) (n + N / n * n) n N / n * n N / n N n n (N / n) N n 2 long n n long N N public class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        long N = Long.parseLong (reader.readLine());
        System.out.println (calc (1, N) - calc (3, N) - calc (5, N) +
                            calc (15, N));
        return;
    }

    static long calc (long n, long N) {
        return (n + N / n * n) * (N / n) / 2;
    }
} public class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        long N = Long.parseLong (reader.readLine());
        System.out.println (calc (1, N) - calc (3, N) - calc (5, N) +
                            calc (15, N));
        return;
    }

    static long calc (long n, long N) {
        return (n + N / n * n) * (N / n) / 2;
    }
} Main
import java.io.*;

public class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        long N = Long.parseLong (reader.readLine());
        System.out.println (calc (1, N) - calc (3, N) - calc (5, N) +
                            calc (15, N));
        return;
    }

    static long calc (long n, long N) {
        return (n + N / n * n) * (N / n) / 2;
    }
}