import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		try {
			int N = sc.nextInt();
			long ans = 0;
			String[] retsu = new String[N + 1];
			for (int i = 1; i <= N; i++) {
				boolean three = false;
				boolean five = false;
				retsu[i] = String.valueOf(i);
				if (i % 3 == 0) {
					three = true;
					retsu[i] = "Fizz";
				}
				if (i % 5 == 0) {
					five = true;
					retsu[i] = "Buzz";
				}

				if (three & five) {
					retsu[i] = "FizzBuzz";
				}
			}
			for (int i = 1; i <= N; i++) {
				try {
					int num = Integer.parseInt(retsu[i]);
					ans += num;
				} catch (NumberFormatException e) {

				}

			}

			System.out.println(ans);
		} catch (Exception e) {

		} finally

		{
			sc.close();
		}
	}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		try {
			int N = sc.nextInt();
			long ans = 0;
			String[] retsu = new String[N + 1];
			for (int i = 1; i <= N; i++) {
				boolean three = false;
				boolean five = false;
				retsu[i] = String.valueOf(i);
				if (i % 3 == 0) {
					three = true;
					retsu[i] = "Fizz";
				}
				if (i % 5 == 0) {
					five = true;
					retsu[i] = "Buzz";
				}

				if (three & five) {
					retsu[i] = "FizzBuzz";
				}
			}
			for (int i = 1; i <= N; i++) {
				try {
					int num = Integer.parseInt(retsu[i]);
					ans += num;
				} catch (NumberFormatException e) {

				}

			}

			System.out.println(ans);
		} catch (Exception e) {

		} finally

		{
			sc.close();
		}
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		try {
			int N = sc.nextInt();
			long ans = 0;
			String[] retsu = new String[N + 1];
			for (int i = 1; i <= N; i++) {
				boolean three = false;
				boolean five = false;
				retsu[i] = String.valueOf(i);
				if (i % 3 == 0) {
					three = true;
					retsu[i] = "Fizz";
				}
				if (i % 5 == 0) {
					five = true;
					retsu[i] = "Buzz";
				}

				if (three & five) {
					retsu[i] = "FizzBuzz";
				}
			}
			for (int i = 1; i <= N; i++) {
				try {
					int num = Integer.parseInt(retsu[i]);
					ans += num;
				} catch (NumberFormatException e) {

				}

			}

			System.out.println(ans);
		} catch (Exception e) {

		} finally

		{
			sc.close();
		}
	} main {
		Scanner sc = new Scanner(System.in);
		try {
			int N = sc.nextInt();
			long ans = 0;
			String[] retsu = new String[N + 1];
			for (int i = 1; i <= N; i++) {
				boolean three = false;
				boolean five = false;
				retsu[i] = String.valueOf(i);
				if (i % 3 == 0) {
					three = true;
					retsu[i] = "Fizz";
				}
				if (i % 5 == 0) {
					five = true;
					retsu[i] = "Buzz";
				}

				if (three & five) {
					retsu[i] = "FizzBuzz";
				}
			}
			for (int i = 1; i <= N; i++) {
				try {
					int num = Integer.parseInt(retsu[i]);
					ans += num;
				} catch (NumberFormatException e) {

				}

			}

			System.out.println(ans);
		} catch (Exception e) {

		} finally

		{
			sc.close();
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) try {
			int N = sc.nextInt();
			long ans = 0;
			String[] retsu = new String[N + 1];
			for (int i = 1; i <= N; i++) {
				boolean three = false;
				boolean five = false;
				retsu[i] = String.valueOf(i);
				if (i % 3 == 0) {
					three = true;
					retsu[i] = "Fizz";
				}
				if (i % 5 == 0) {
					five = true;
					retsu[i] = "Buzz";
				}

				if (three & five) {
					retsu[i] = "FizzBuzz";
				}
			}
			for (int i = 1; i <= N; i++) {
				try {
					int num = Integer.parseInt(retsu[i]);
					ans += num;
				} catch (NumberFormatException e) {

				}

			}

			System.out.println(ans);
		} catch (Exception e) {

		} finally

		{
			sc.close();
		} catch (Exception e) {

		} Exception e {

		} {
			sc.close();
		} sc.close() sc.close sc {
			int N = sc.nextInt();
			long ans = 0;
			String[] retsu = new String[N + 1];
			for (int i = 1; i <= N; i++) {
				boolean three = false;
				boolean five = false;
				retsu[i] = String.valueOf(i);
				if (i % 3 == 0) {
					three = true;
					retsu[i] = "Fizz";
				}
				if (i % 5 == 0) {
					five = true;
					retsu[i] = "Buzz";
				}

				if (three & five) {
					retsu[i] = "FizzBuzz";
				}
			}
			for (int i = 1; i <= N; i++) {
				try {
					int num = Integer.parseInt(retsu[i]);
					ans += num;
				} catch (NumberFormatException e) {

				}

			}

			System.out.println(ans);
		} int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc long ans = 0; ans 0 String[] retsu = new String[N + 1]; retsu new String[N + 1] N + 1 N 1 for (int i = 1; i <= N; i++) {
				boolean three = false;
				boolean five = false;
				retsu[i] = String.valueOf(i);
				if (i % 3 == 0) {
					three = true;
					retsu[i] = "Fizz";
				}
				if (i % 5 == 0) {
					five = true;
					retsu[i] = "Buzz";
				}

				if (three & five) {
					retsu[i] = "FizzBuzz";
				}
			} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
				boolean three = false;
				boolean five = false;
				retsu[i] = String.valueOf(i);
				if (i % 3 == 0) {
					three = true;
					retsu[i] = "Fizz";
				}
				if (i % 5 == 0) {
					five = true;
					retsu[i] = "Buzz";
				}

				if (three & five) {
					retsu[i] = "FizzBuzz";
				}
			} {
				boolean three = false;
				boolean five = false;
				retsu[i] = String.valueOf(i);
				if (i % 3 == 0) {
					three = true;
					retsu[i] = "Fizz";
				}
				if (i % 5 == 0) {
					five = true;
					retsu[i] = "Buzz";
				}

				if (three & five) {
					retsu[i] = "FizzBuzz";
				}
			} boolean three = false; three false boolean five = false; five false retsu[i] = String.valueOf(i) retsu[i] retsu i String.valueOf(i) String.valueOf String i if (i % 3 == 0) {
					three = true;
					retsu[i] = "Fizz";
				} i % 3 == 0 i % 3 i 3 0 {
					three = true;
					retsu[i] = "Fizz";
				} three = true three true retsu[i] = "Fizz" retsu[i] retsu i "Fizz" if (i % 5 == 0) {
					five = true;
					retsu[i] = "Buzz";
				} i % 5 == 0 i % 5 i 5 0 {
					five = true;
					retsu[i] = "Buzz";
				} five = true five true retsu[i] = "Buzz" retsu[i] retsu i "Buzz" if (three & five) {
					retsu[i] = "FizzBuzz";
				} three & five three five {
					retsu[i] = "FizzBuzz";
				} retsu[i] = "FizzBuzz" retsu[i] retsu i "FizzBuzz" for (int i = 1; i <= N; i++) {
				try {
					int num = Integer.parseInt(retsu[i]);
					ans += num;
				} catch (NumberFormatException e) {

				}

			} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
				try {
					int num = Integer.parseInt(retsu[i]);
					ans += num;
				} catch (NumberFormatException e) {

				}

			} {
				try {
					int num = Integer.parseInt(retsu[i]);
					ans += num;
				} catch (NumberFormatException e) {

				}

			} try {
					int num = Integer.parseInt(retsu[i]);
					ans += num;
				} catch (NumberFormatException e) {

				} catch (NumberFormatException e) {

				} NumberFormatException e {

				} {
					int num = Integer.parseInt(retsu[i]);
					ans += num;
				} int num = Integer.parseInt(retsu[i]); num Integer.parseInt(retsu[i]) Integer.parseInt Integer retsu[i] retsu i ans += num ans num System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		try {
			int N = sc.nextInt();
			long ans = 0;
			String[] retsu = new String[N + 1];
			for (int i = 1; i <= N; i++) {
				boolean three = false;
				boolean five = false;
				retsu[i] = String.valueOf(i);
				if (i % 3 == 0) {
					three = true;
					retsu[i] = "Fizz";
				}
				if (i % 5 == 0) {
					five = true;
					retsu[i] = "Buzz";
				}

				if (three & five) {
					retsu[i] = "FizzBuzz";
				}
			}
			for (int i = 1; i <= N; i++) {
				try {
					int num = Integer.parseInt(retsu[i]);
					ans += num;
				} catch (NumberFormatException e) {

				}

			}

			System.out.println(ans);
		} catch (Exception e) {

		} finally

		{
			sc.close();
		}
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		try {
			int N = sc.nextInt();
			long ans = 0;
			String[] retsu = new String[N + 1];
			for (int i = 1; i <= N; i++) {
				boolean three = false;
				boolean five = false;
				retsu[i] = String.valueOf(i);
				if (i % 3 == 0) {
					three = true;
					retsu[i] = "Fizz";
				}
				if (i % 5 == 0) {
					five = true;
					retsu[i] = "Buzz";
				}

				if (three & five) {
					retsu[i] = "FizzBuzz";
				}
			}
			for (int i = 1; i <= N; i++) {
				try {
					int num = Integer.parseInt(retsu[i]);
					ans += num;
				} catch (NumberFormatException e) {

				}

			}

			System.out.println(ans);
		} catch (Exception e) {

		} finally

		{
			sc.close();
		}
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		try {
			int N = sc.nextInt();
			long ans = 0;
			String[] retsu = new String[N + 1];
			for (int i = 1; i <= N; i++) {
				boolean three = false;
				boolean five = false;
				retsu[i] = String.valueOf(i);
				if (i % 3 == 0) {
					three = true;
					retsu[i] = "Fizz";
				}
				if (i % 5 == 0) {
					five = true;
					retsu[i] = "Buzz";
				}

				if (three & five) {
					retsu[i] = "FizzBuzz";
				}
			}
			for (int i = 1; i <= N; i++) {
				try {
					int num = Integer.parseInt(retsu[i]);
					ans += num;
				} catch (NumberFormatException e) {

				}

			}

			System.out.println(ans);
		} catch (Exception e) {

		} finally

		{
			sc.close();
		}
	}

}
