import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        Integer N = input.nextInt();
        String[] a = new String[N+1];
        long sum = 0;

        for (int i = 0; i <= N; i++) {
            if ((i % 3 == 0) && (i % 5 == 0)) {
                a[i] = "FizzBuzz";
            } else if (i % 3 == 0) {
                a[i] = "Fizz";
            } else if (i % 5 == 0) {
                a[i] = "Buzz";
            } else {
                a[i] = Integer.toString(i);
                sum += i;
            }
        }

        System.out.println(sum);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        Integer N = input.nextInt();
        String[] a = new String[N+1];
        long sum = 0;

        for (int i = 0; i <= N; i++) {
            if ((i % 3 == 0) && (i % 5 == 0)) {
                a[i] = "FizzBuzz";
            } else if (i % 3 == 0) {
                a[i] = "Fizz";
            } else if (i % 5 == 0) {
                a[i] = "Buzz";
            } else {
                a[i] = Integer.toString(i);
                sum += i;
            }
        }

        System.out.println(sum);
    }
} Main public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        Integer N = input.nextInt();
        String[] a = new String[N+1];
        long sum = 0;

        for (int i = 0; i <= N; i++) {
            if ((i % 3 == 0) && (i % 5 == 0)) {
                a[i] = "FizzBuzz";
            } else if (i % 3 == 0) {
                a[i] = "Fizz";
            } else if (i % 5 == 0) {
                a[i] = "Buzz";
            } else {
                a[i] = Integer.toString(i);
                sum += i;
            }
        }

        System.out.println(sum);
    } main {
        Scanner input = new Scanner(System.in);
        Integer N = input.nextInt();
        String[] a = new String[N+1];
        long sum = 0;

        for (int i = 0; i <= N; i++) {
            if ((i % 3 == 0) && (i % 5 == 0)) {
                a[i] = "FizzBuzz";
            } else if (i % 3 == 0) {
                a[i] = "Fizz";
            } else if (i % 5 == 0) {
                a[i] = "Buzz";
            } else {
                a[i] = Integer.toString(i);
                sum += i;
            }
        }

        System.out.println(sum);
    } Scanner input = new Scanner(System.in); input new Scanner(System.in) Integer N = input.nextInt(); N input.nextInt() input.nextInt input String[] a = new String[N+1]; a new String[N+1] N+1 N 1 long sum = 0; sum 0 for (int i = 0; i <= N; i++) {
            if ((i % 3 == 0) && (i % 5 == 0)) {
                a[i] = "FizzBuzz";
            } else if (i % 3 == 0) {
                a[i] = "Fizz";
            } else if (i % 5 == 0) {
                a[i] = "Buzz";
            } else {
                a[i] = Integer.toString(i);
                sum += i;
            }
        } int i = 0; int i = 0; i 0 i <= N i N i++ i++ i {
            if ((i % 3 == 0) && (i % 5 == 0)) {
                a[i] = "FizzBuzz";
            } else if (i % 3 == 0) {
                a[i] = "Fizz";
            } else if (i % 5 == 0) {
                a[i] = "Buzz";
            } else {
                a[i] = Integer.toString(i);
                sum += i;
            }
        } {
            if ((i % 3 == 0) && (i % 5 == 0)) {
                a[i] = "FizzBuzz";
            } else if (i % 3 == 0) {
                a[i] = "Fizz";
            } else if (i % 5 == 0) {
                a[i] = "Buzz";
            } else {
                a[i] = Integer.toString(i);
                sum += i;
            }
        } if ((i % 3 == 0) && (i % 5 == 0)) {
                a[i] = "FizzBuzz";
            } else if (i % 3 == 0) {
                a[i] = "Fizz";
            } else if (i % 5 == 0) {
                a[i] = "Buzz";
            } else {
                a[i] = Integer.toString(i);
                sum += i;
            } (i % 3 == 0) && (i % 5 == 0) (i % 3 == 0) i % 3 i 3 0 (i % 5 == 0) i % 5 i 5 0 {
                a[i] = "FizzBuzz";
            } a[i] = "FizzBuzz" a[i] a i "FizzBuzz" if (i % 3 == 0) {
                a[i] = "Fizz";
            } else if (i % 5 == 0) {
                a[i] = "Buzz";
            } else {
                a[i] = Integer.toString(i);
                sum += i;
            } i % 3 == 0 i % 3 i 3 0 {
                a[i] = "Fizz";
            } a[i] = "Fizz" a[i] a i "Fizz" if (i % 5 == 0) {
                a[i] = "Buzz";
            } else {
                a[i] = Integer.toString(i);
                sum += i;
            } i % 5 == 0 i % 5 i 5 0 {
                a[i] = "Buzz";
            } a[i] = "Buzz" a[i] a i "Buzz" {
                a[i] = Integer.toString(i);
                sum += i;
            } a[i] = Integer.toString(i) a[i] a i Integer.toString(i) Integer.toString Integer i 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 input = new Scanner(System.in);
        Integer N = input.nextInt();
        String[] a = new String[N+1];
        long sum = 0;

        for (int i = 0; i <= N; i++) {
            if ((i % 3 == 0) && (i % 5 == 0)) {
                a[i] = "FizzBuzz";
            } else if (i % 3 == 0) {
                a[i] = "Fizz";
            } else if (i % 5 == 0) {
                a[i] = "Buzz";
            } else {
                a[i] = Integer.toString(i);
                sum += i;
            }
        }

        System.out.println(sum);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        Integer N = input.nextInt();
        String[] a = new String[N+1];
        long sum = 0;

        for (int i = 0; i <= N; i++) {
            if ((i % 3 == 0) && (i % 5 == 0)) {
                a[i] = "FizzBuzz";
            } else if (i % 3 == 0) {
                a[i] = "Fizz";
            } else if (i % 5 == 0) {
                a[i] = "Buzz";
            } else {
                a[i] = Integer.toString(i);
                sum += i;
            }
        }

        System.out.println(sum);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        Integer N = input.nextInt();
        String[] a = new String[N+1];
        long sum = 0;

        for (int i = 0; i <= N; i++) {
            if ((i % 3 == 0) && (i % 5 == 0)) {
                a[i] = "FizzBuzz";
            } else if (i % 3 == 0) {
                a[i] = "Fizz";
            } else if (i % 5 == 0) {
                a[i] = "Buzz";
            } else {
                a[i] = Integer.toString(i);
                sum += i;
            }
        }

        System.out.println(sum);
    }
}