//FizzBuzz

//lucky7

#include<iostream>
using namespace std;

int main ()
{
	//整数の入力
	int N;
	cin >> N;

	int sum = 0;
	int ai = 0;
	for(i=0;i<N;i++){
		ai = ai + 1
	}


	//出力
	for(i=0;i<N;i++){
		if((ai%3 ==0) && (ai%5 != 0)){
			ai = Fizz
		}else if((ai%3 !=0) && (ai%5 == 0)){
			ai = Bizz
		}else if((ai%3 ==0) && (ai%5 == 0)){
			ai = FizzBizz
		}else{
			sum = sum + ai
		}}

	cout << sum << endl;
	
	return 0;
}