
import java.util.*;
import java.lang.*;

public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());

        // 合計値
        List<Integer> total = new ArrayList<Integer>();

        long sum = 0L;

        for (int i =0; i <= n; i++) {
            boolean fizz = i % 3  == 0;
            boolean buzz =  i % 5 == 0;
            if (fizz || buzz)  continue;

            fizz = false;
            buzz = false;
            sum += i;
        }



        System.out.println(sum);
    }
} import java.util.*; util.* java import java.lang.*; lang.* java public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());

        // 合計値
        List<Integer> total = new ArrayList<Integer>();

        long sum = 0L;

        for (int i =0; i <= n; i++) {
            boolean fizz = i % 3  == 0;
            boolean buzz =  i % 5 == 0;
            if (fizz || buzz)  continue;

            fizz = false;
            buzz = false;
            sum += i;
        }



        System.out.println(sum);
    }
} Main public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());

        // 合計値
        List<Integer> total = new ArrayList<Integer>();

        long sum = 0L;

        for (int i =0; i <= n; i++) {
            boolean fizz = i % 3  == 0;
            boolean buzz =  i % 5 == 0;
            if (fizz || buzz)  continue;

            fizz = false;
            buzz = false;
            sum += i;
        }



        System.out.println(sum);
    } main {
        //コード
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());

        // 合計値
        List<Integer> total = new ArrayList<Integer>();

        long sum = 0L;

        for (int i =0; i <= n; i++) {
            boolean fizz = i % 3  == 0;
            boolean buzz =  i % 5 == 0;
            if (fizz || buzz)  continue;

            fizz = false;
            buzz = false;
            sum += i;
        }



        System.out.println(sum);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = Integer.parseInt(scanner.next()); n Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner List<Integer> total = new ArrayList<Integer>(); total new ArrayList<Integer>() long sum = 0L; sum 0L for (int i =0; i <= n; i++) {
            boolean fizz = i % 3  == 0;
            boolean buzz =  i % 5 == 0;
            if (fizz || buzz)  continue;

            fizz = false;
            buzz = false;
            sum += i;
        } int i =0; int i =0; i 0 i <= n i n i++ i++ i {
            boolean fizz = i % 3  == 0;
            boolean buzz =  i % 5 == 0;
            if (fizz || buzz)  continue;

            fizz = false;
            buzz = false;
            sum += i;
        } {
            boolean fizz = i % 3  == 0;
            boolean buzz =  i % 5 == 0;
            if (fizz || buzz)  continue;

            fizz = false;
            buzz = false;
            sum += i;
        } boolean fizz = i % 3  == 0; fizz i % 3  == 0 i % 3 i 3 0 boolean buzz =  i % 5 == 0; buzz i % 5 == 0 i % 5 i 5 0 if (fizz || buzz)  continue; fizz || buzz fizz buzz continue; fizz = false fizz false buzz = false buzz false sum += i sum i System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());

        // 合計値
        List<Integer> total = new ArrayList<Integer>();

        long sum = 0L;

        for (int i =0; i <= n; i++) {
            boolean fizz = i % 3  == 0;
            boolean buzz =  i % 5 == 0;
            if (fizz || buzz)  continue;

            fizz = false;
            buzz = false;
            sum += i;
        }



        System.out.println(sum);
    }
} public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());

        // 合計値
        List<Integer> total = new ArrayList<Integer>();

        long sum = 0L;

        for (int i =0; i <= n; i++) {
            boolean fizz = i % 3  == 0;
            boolean buzz =  i % 5 == 0;
            if (fizz || buzz)  continue;

            fizz = false;
            buzz = false;
            sum += i;
        }



        System.out.println(sum);
    }
} Main

import java.util.*;
import java.lang.*;

public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());

        // 合計値
        List<Integer> total = new ArrayList<Integer>();

        long sum = 0L;

        for (int i =0; i <= n; i++) {
            boolean fizz = i % 3  == 0;
            boolean buzz =  i % 5 == 0;
            if (fizz || buzz)  continue;

            fizz = false;
            buzz = false;
            sum += i;
        }



        System.out.println(sum);
    }
}