
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		String n = scanner.nextLine();
		long result = 0;
		String[] fizzList = new String[Integer.parseInt(n)];

		for(int i = 1; i <= Integer.parseInt(n); i++) {
			if(i % 3 == 0 && i % 5 ==0) {
				fizzList[i - 1] = "FizzBuzz";
			}else if(i % 3 == 0){
				fizzList[i - 1] = "Fizz";
			}else if(i % 5 == 0){
				fizzList[i - 1] = "Buzz";
			}else {
				fizzList[i - 1] = String.valueOf(i);
				result += i;
			}
		}

		System.out.println(result);

	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		String n = scanner.nextLine();
		long result = 0;
		String[] fizzList = new String[Integer.parseInt(n)];

		for(int i = 1; i <= Integer.parseInt(n); i++) {
			if(i % 3 == 0 && i % 5 ==0) {
				fizzList[i - 1] = "FizzBuzz";
			}else if(i % 3 == 0){
				fizzList[i - 1] = "Fizz";
			}else if(i % 5 == 0){
				fizzList[i - 1] = "Buzz";
			}else {
				fizzList[i - 1] = String.valueOf(i);
				result += i;
			}
		}

		System.out.println(result);

	}

} Main public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		String n = scanner.nextLine();
		long result = 0;
		String[] fizzList = new String[Integer.parseInt(n)];

		for(int i = 1; i <= Integer.parseInt(n); i++) {
			if(i % 3 == 0 && i % 5 ==0) {
				fizzList[i - 1] = "FizzBuzz";
			}else if(i % 3 == 0){
				fizzList[i - 1] = "Fizz";
			}else if(i % 5 == 0){
				fizzList[i - 1] = "Buzz";
			}else {
				fizzList[i - 1] = String.valueOf(i);
				result += i;
			}
		}

		System.out.println(result);

	} main {

		Scanner scanner = new Scanner(System.in);
		String n = scanner.nextLine();
		long result = 0;
		String[] fizzList = new String[Integer.parseInt(n)];

		for(int i = 1; i <= Integer.parseInt(n); i++) {
			if(i % 3 == 0 && i % 5 ==0) {
				fizzList[i - 1] = "FizzBuzz";
			}else if(i % 3 == 0){
				fizzList[i - 1] = "Fizz";
			}else if(i % 5 == 0){
				fizzList[i - 1] = "Buzz";
			}else {
				fizzList[i - 1] = String.valueOf(i);
				result += i;
			}
		}

		System.out.println(result);

	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String n = scanner.nextLine(); n scanner.nextLine() scanner.nextLine scanner long result = 0; result 0 String[] fizzList = new String[Integer.parseInt(n)]; fizzList new String[Integer.parseInt(n)] Integer.parseInt(n) Integer.parseInt Integer n for(int i = 1; i <= Integer.parseInt(n); i++) {
			if(i % 3 == 0 && i % 5 ==0) {
				fizzList[i - 1] = "FizzBuzz";
			}else if(i % 3 == 0){
				fizzList[i - 1] = "Fizz";
			}else if(i % 5 == 0){
				fizzList[i - 1] = "Buzz";
			}else {
				fizzList[i - 1] = String.valueOf(i);
				result += i;
			}
		} int i = 1; int i = 1; i 1 i <= Integer.parseInt(n) i Integer.parseInt(n) Integer.parseInt Integer n i++ i++ i {
			if(i % 3 == 0 && i % 5 ==0) {
				fizzList[i - 1] = "FizzBuzz";
			}else if(i % 3 == 0){
				fizzList[i - 1] = "Fizz";
			}else if(i % 5 == 0){
				fizzList[i - 1] = "Buzz";
			}else {
				fizzList[i - 1] = String.valueOf(i);
				result += i;
			}
		} {
			if(i % 3 == 0 && i % 5 ==0) {
				fizzList[i - 1] = "FizzBuzz";
			}else if(i % 3 == 0){
				fizzList[i - 1] = "Fizz";
			}else if(i % 5 == 0){
				fizzList[i - 1] = "Buzz";
			}else {
				fizzList[i - 1] = String.valueOf(i);
				result += i;
			}
		} if(i % 3 == 0 && i % 5 ==0) {
				fizzList[i - 1] = "FizzBuzz";
			}else if(i % 3 == 0){
				fizzList[i - 1] = "Fizz";
			}else if(i % 5 == 0){
				fizzList[i - 1] = "Buzz";
			}else {
				fizzList[i - 1] = String.valueOf(i);
				result += i;
			} i % 3 == 0 && i % 5 ==0 i % 3 == 0 i % 3 i 3 0 i % 5 ==0 i % 5 i 5 0 {
				fizzList[i - 1] = "FizzBuzz";
			} fizzList[i - 1] = "FizzBuzz" fizzList[i - 1] fizzList i - 1 i 1 "FizzBuzz" if(i % 3 == 0){
				fizzList[i - 1] = "Fizz";
			}else if(i % 5 == 0){
				fizzList[i - 1] = "Buzz";
			}else {
				fizzList[i - 1] = String.valueOf(i);
				result += i;
			} i % 3 == 0 i % 3 i 3 0 {
				fizzList[i - 1] = "Fizz";
			} fizzList[i - 1] = "Fizz" fizzList[i - 1] fizzList i - 1 i 1 "Fizz" if(i % 5 == 0){
				fizzList[i - 1] = "Buzz";
			}else {
				fizzList[i - 1] = String.valueOf(i);
				result += i;
			} i % 5 == 0 i % 5 i 5 0 {
				fizzList[i - 1] = "Buzz";
			} fizzList[i - 1] = "Buzz" fizzList[i - 1] fizzList i - 1 i 1 "Buzz" {
				fizzList[i - 1] = String.valueOf(i);
				result += i;
			} fizzList[i - 1] = String.valueOf(i) fizzList[i - 1] fizzList i - 1 i 1 String.valueOf(i) String.valueOf String i result += i result i System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		String n = scanner.nextLine();
		long result = 0;
		String[] fizzList = new String[Integer.parseInt(n)];

		for(int i = 1; i <= Integer.parseInt(n); i++) {
			if(i % 3 == 0 && i % 5 ==0) {
				fizzList[i - 1] = "FizzBuzz";
			}else if(i % 3 == 0){
				fizzList[i - 1] = "Fizz";
			}else if(i % 5 == 0){
				fizzList[i - 1] = "Buzz";
			}else {
				fizzList[i - 1] = String.valueOf(i);
				result += i;
			}
		}

		System.out.println(result);

	}

} public class Main {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		String n = scanner.nextLine();
		long result = 0;
		String[] fizzList = new String[Integer.parseInt(n)];

		for(int i = 1; i <= Integer.parseInt(n); i++) {
			if(i % 3 == 0 && i % 5 ==0) {
				fizzList[i - 1] = "FizzBuzz";
			}else if(i % 3 == 0){
				fizzList[i - 1] = "Fizz";
			}else if(i % 5 == 0){
				fizzList[i - 1] = "Buzz";
			}else {
				fizzList[i - 1] = String.valueOf(i);
				result += i;
			}
		}

		System.out.println(result);

	}

} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		String n = scanner.nextLine();
		long result = 0;
		String[] fizzList = new String[Integer.parseInt(n)];

		for(int i = 1; i <= Integer.parseInt(n); i++) {
			if(i % 3 == 0 && i % 5 ==0) {
				fizzList[i - 1] = "FizzBuzz";
			}else if(i % 3 == 0){
				fizzList[i - 1] = "Fizz";
			}else if(i % 5 == 0){
				fizzList[i - 1] = "Buzz";
			}else {
				fizzList[i - 1] = String.valueOf(i);
				result += i;
			}
		}

		System.out.println(result);

	}

}
