stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>

#include <cstring>



#define pi 2*acos(0.00)

#define ll long long

#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define nl '\n'

#define null '\0'



using namespace std;



int main()

{

    fastio;



    ll n,i,sum=0;

    cin>>n;

    for(i=1;i<=n;i++)

    {

        if(i%3!=0&&i%5!=0)

        sum+=i;

    }    

    cout<<sum;

}

// Faster C++ solution for the same problem (measured speedup: 1.9154024705862651x):
#include<stdio.h>

int main()

{

	int N;

	long long int X=0;

	scanf("%d",&N);

	for(int i=1;i<=N;i++){

		if(i%3==0&&i%5==0){

		}

		else if(i%3==0){

		}

		else if(i%5==0){

		}

		else{	

		X=X+i;

		}

	}

		printf("%lld",X);

		

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main()

{

	long long  n;

	cin>>n;

	long long  a[n+1];

	for(int i=1;i<=n;i++)

	a[i]=i;

	for(long long i=1;i<=n;i++)

	{

		if(a[i]%3==0||a[i]%5==0)

		a[i]=0;

	}

	long long sum=0;

	for(long long i=1;i<=n;i++)

	sum+=a[i];

	cout<<sum;

}

// Faster C++ solution for the same problem (measured speedup: 5.253369850089034x):
#include<stdio.h>

int main()

{

	int N;

	long long int X=0;

	scanf("%d",&N);

	for(int i=1;i<=N;i++){

		if(i%3==0&&i%5==0){

		}

		else if(i%3==0){

		}

		else if(i%5==0){

		}

		else{	

		X=X+i;

		}

	}

		printf("%lld",X);

		

}
// Slower C++ solution:
#include<iostream>

#include<cstdio>

#include<iomanip>

#include<algorithm>

#include<cstring>

#include<cmath>

#include<vector>

#include<map>

using namespace std;

string s[10005];

int main() 

{

	int n;

    cin>>n;

    long long ans=0;

    for (int i=1;i<=n;i++)

    {

        if (i%3==0)

        continue;

        else if (i%5==0)

        continue;

        else

        ans+=i;

    }

    cout<<ans<<endl;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 2.2651478649883865x):
#include<stdio.h>

int main()

{

	int N;

	long long int X=0;

	scanf("%d",&N);

	for(int i=1;i<=N;i++){

		if(i%3==0&&i%5==0){

		}

		else if(i%3==0){

		}

		else if(i%5==0){

		}

		else{	

		X=X+i;

		}

	}

		printf("%lld",X);

		

}
// Slower C++ solution:
#include <bits/stdc++.h>



#define forn(i, n) for (int i = 0; i < int(n); ++i)

#define for1(i, n) for (int i = 1; i <= int(n); ++i)

#define ms(a, x) memset(a, x, sizeof(a))

#define F first

#define S second

#define all(x) (x).begin(),(x).end()



using namespace std;

typedef long long ll;

typedef pair<int, int> pii;

const int INF = 0x3f3f3f3f;

mt19937 gen(random_device{}());

template<typename... Args> void write(Args... args) { ((cout << args << " "), ...); cout<<endl;}



int main() {

    ios::sync_with_stdio(false);

    cin.tie(nullptr);

    int n;

    cin>>n;

    ll sum=0;

    for1(i,n){

        if(i%3 and i%5) sum+=i;

    }

    cout<<sum;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 2.056323450087345x):
#include<stdio.h>

int main()

{

	int N;

	long long int X=0;

	scanf("%d",&N);

	for(int i=1;i<=N;i++){

		if(i%3==0&&i%5==0){

		}

		else if(i%3==0){

		}

		else if(i%5==0){

		}

		else{	

		X=X+i;

		}

	}

		printf("%lld",X);

		

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



int main()

{

    long long n;

    cin>>n;

    long long count=0;

    for(long long i=1;i<=n;i++){

        if((i%3 == 0) && (i%5==0))

            {//cout<<"FizzBuzz\n";

            count+=i;}

        else if(i%3 == 0)

            {//cout<<"Fizz\n";

            count+=i;}

        else if(i%5 == 0)

            {//cout<<"Buzz\n";

            count+=i;}

     }

     cout<<(n*(n+1))/2-count<<endl;

    return 0;

}  

// Faster C++ solution for the same problem (measured speedup: 1.9007580652821707x):
#include<stdio.h>

int main()

{

	int N;

	long long int X=0;

	scanf("%d",&N);

	for(int i=1;i<=N;i++){

		if(i%3==0&&i%5==0){

		}

		else if(i%3==0){

		}

		else if(i%5==0){

		}

		else{	

		X=X+i;

		}

	}

		printf("%lld",X);

		

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

inline ll calc(ll x) {

	return (x+1)*x/2; 

}

int main() {

	ll n,ans;

	cin>>n;

	ans=calc(n)-calc(n/3)*3-calc(n/5)*5+calc(n/15)*15;

	cout<<ans<<endl;

	return 0;

} 

// Faster C++ solution for the same problem (measured speedup: 1.1125185688714416x):
#include<stdio.h>

int main()

{

	int N;

	long long int X=0;

	scanf("%d",&N);

	for(int i=1;i<=N;i++){

		if(i%3==0&&i%5==0){

		}

		else if(i%3==0){

		}

		else if(i%5==0){

		}

		else{	

		X=X+i;

		}

	}

		printf("%lld",X);

		

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

	long long n,sum=0;

	cin>>n;

	for(int i=1;i<=n;i++){

		if(i%3==0 || i%5==0){

			continue;

		}

		else{

			sum+=i;

		}

	}

	cout<<sum;

}

// Faster C++ solution for the same problem (measured speedup: 1.8979892695110328x):
#include <stdio.h>



int main() {



	long long int n;

	scanf("%lld", &n);

	

	long long sum=0;	

	for(long long int i=1; i<=n; i++){

		if(i%3!=0 && i%5!=0){

			sum+=i;

		}

	}



	printf("%lld\n", sum);

	

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int N;

    long long int sum=0;

    scanf("%d",&N);

    for(long long int i=1;i<=N;i++)

    {

        if(i%3!=0 && i%5!=0 && (i%3!=0 && i%5!=0))

        {

            sum = sum + i;

        }

    }

    printf("%lld\n",sum);

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.8878612975320592x):
#include <stdio.h>



int main() {



	long long int n;

	scanf("%lld", &n);

	

	long long sum=0;	

	for(long long int i=1; i<=n; i++){

		if(i%3!=0 && i%5!=0){

			sum+=i;

		}

	}



	printf("%lld\n", sum);

	

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    long long unsigned i,N,sum=0;

    cin>>N;



    for(i=1;i<=N;i++){

        if(i%3!=0&&i%5!=0){

            sum=sum+i;

        }

    }

    cout<<sum<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.8997636241086981x):
#include <stdio.h>



int main() {



	long long int n;

	scanf("%lld", &n);

	

	long long sum=0;	

	for(long long int i=1; i<=n; i++){

		if(i%3!=0 && i%5!=0){

			sum+=i;

		}

	}



	printf("%lld\n", sum);

	

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#include <cstring>



#define pi 2*acos(0.00)

#define ll long long

#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define nl '\n'

#define null '\0'



using namespace std;



int main()

{

    fastio;



    ll n,i,sum=0;

    cin>>n;

    for(i=1;i<=n;i++)

    {

        if(i%3!=0&&i%5!=0)

        sum+=i;

    }    

    cout<<sum;

}

// Faster C++ solution for the same problem (measured speedup: 1.9144672005311714x):
#include <stdio.h>



int main() {



	long long int n;

	scanf("%lld", &n);

	

	long long sum=0;	

	for(long long int i=1; i<=n; i++){

		if(i%3!=0 && i%5!=0){

			sum+=i;

		}

	}



	printf("%lld\n", sum);

	

    return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main()

{

	long long  n;

	cin>>n;

	long long  a[n+1];

	for(int i=1;i<=n;i++)

	a[i]=i;

	for(long long i=1;i<=n;i++)

	{

		if(a[i]%3==0||a[i]%5==0)

		a[i]=0;

	}

	long long sum=0;

	for(long long i=1;i<=n;i++)

	sum+=a[i];

	cout<<sum;

}

// Faster C++ solution for the same problem (measured speedup: 5.241625814281637x):
#include <stdio.h>



int main() {



	long long int n;

	scanf("%lld", &n);

	

	long long sum=0;	

	for(long long int i=1; i<=n; i++){

		if(i%3!=0 && i%5!=0){

			sum+=i;

		}

	}



	printf("%lld\n", sum);

	

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cstdio>

#include<iomanip>

#include<algorithm>

#include<cstring>

#include<cmath>

#include<vector>

#include<map>

using namespace std;

string s[10005];

int main() 

{

	int n;

    cin>>n;

    long long ans=0;

    for (int i=1;i<=n;i++)

    {

        if (i%3==0)

        continue;

        else if (i%5==0)

        continue;

        else

        ans+=i;

    }

    cout<<ans<<endl;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 2.2640418180864867x):
#include <stdio.h>



int main() {



	long long int n;

	scanf("%lld", &n);

	

	long long sum=0;	

	for(long long int i=1; i<=n; i++){

		if(i%3!=0 && i%5!=0){

			sum+=i;

		}

	}



	printf("%lld\n", sum);

	

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



#define forn(i, n) for (int i = 0; i < int(n); ++i)

#define for1(i, n) for (int i = 1; i <= int(n); ++i)

#define ms(a, x) memset(a, x, sizeof(a))

#define F first

#define S second

#define all(x) (x).begin(),(x).end()



using namespace std;

typedef long long ll;

typedef pair<int, int> pii;

const int INF = 0x3f3f3f3f;

mt19937 gen(random_device{}());

template<typename... Args> void write(Args... args) { ((cout << args << " "), ...); cout<<endl;}



int main() {

    ios::sync_with_stdio(false);

    cin.tie(nullptr);

    int n;

    cin>>n;

    ll sum=0;

    for1(i,n){

        if(i%3 and i%5) sum+=i;

    }

    cout<<sum;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 2.055319369860872x):
#include <stdio.h>



int main() {



	long long int n;

	scanf("%lld", &n);

	

	long long sum=0;	

	for(long long int i=1; i<=n; i++){

		if(i%3!=0 && i%5!=0){

			sum+=i;

		}

	}



	printf("%lld\n", sum);

	

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



int main()

{

    long long n;

    cin>>n;

    long long count=0;

    for(long long i=1;i<=n;i++){

        if((i%3 == 0) && (i%5==0))

            {//cout<<"FizzBuzz\n";

            count+=i;}

        else if(i%3 == 0)

            {//cout<<"Fizz\n";

            count+=i;}

        else if(i%5 == 0)

            {//cout<<"Buzz\n";

            count+=i;}

     }

     cout<<(n*(n+1))/2-count<<endl;

    return 0;

}  

// Faster C++ solution for the same problem (measured speedup: 1.8998299459298489x):
#include <stdio.h>



int main() {



	long long int n;

	scanf("%lld", &n);

	

	long long sum=0;	

	for(long long int i=1; i<=n; i++){

		if(i%3!=0 && i%5!=0){

			sum+=i;

		}

	}



	printf("%lld\n", sum);

	

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

inline ll calc(ll x) {

	return (x+1)*x/2; 

}

int main() {

	ll n,ans;

	cin>>n;

	ans=calc(n)-calc(n/3)*3-calc(n/5)*5+calc(n/15)*15;

	cout<<ans<<endl;

	return 0;

} 

// Faster C++ solution for the same problem (measured speedup: 1.1119753382349673x):
#include <stdio.h>



int main() {



	long long int n;

	scanf("%lld", &n);

	

	long long sum=0;	

	for(long long int i=1; i<=n; i++){

		if(i%3!=0 && i%5!=0){

			sum+=i;

		}

	}



	printf("%lld\n", sum);

	

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

	long long n,sum=0;

	cin>>n;

	for(int i=1;i<=n;i++){

		if(i%3==0 || i%5==0){

			continue;

		}

		else{

			sum+=i;

		}

	}

	cout<<sum;

}

// Faster C++ solution for the same problem (measured speedup: 1.753658418392005x):
#include<stdio.h>



int main()

{

	long long int max,sum = 0;

	scanf("%lld", &max);

	for(int i = 0; i <= max; i++)

	{

		if(i % 3 != 0 && i % 5 != 0)

		{

			sum = sum + i;

		}

	}

	printf("%lld", sum);

return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int N;

    long long int sum=0;

    scanf("%d",&N);

    for(long long int i=1;i<=N;i++)

    {

        if(i%3!=0 && i%5!=0 && (i%3!=0 && i%5!=0))

        {

            sum = sum + i;

        }

    }

    printf("%lld\n",sum);

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.7443006187418832x):
#include<stdio.h>



int main()

{

	long long int max,sum = 0;

	scanf("%lld", &max);

	for(int i = 0; i <= max; i++)

	{

		if(i % 3 != 0 && i % 5 != 0)

		{

			sum = sum + i;

		}

	}

	printf("%lld", sum);

return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    long long unsigned i,N,sum=0;

    cin>>N;



    for(i=1;i<=N;i++){

        if(i%3!=0&&i%5!=0){

            sum=sum+i;

        }

    }

    cout<<sum<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.7552978438236408x):
#include<stdio.h>



int main()

{

	long long int max,sum = 0;

	scanf("%lld", &max);

	for(int i = 0; i <= max; i++)

	{

		if(i % 3 != 0 && i % 5 != 0)

		{

			sum = sum + i;

		}

	}

	printf("%lld", sum);

return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#include <cstring>



#define pi 2*acos(0.00)

#define ll long long

#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define nl '\n'

#define null '\0'



using namespace std;



int main()

{

    fastio;



    ll n,i,sum=0;

    cin>>n;

    for(i=1;i<=n;i++)

    {

        if(i%3!=0&&i%5!=0)

        sum+=i;

    }    

    cout<<sum;

}

// Faster C++ solution for the same problem (measured speedup: 1.7688833002790312x):
#include<stdio.h>



int main()

{

	long long int max,sum = 0;

	scanf("%lld", &max);

	for(int i = 0; i <= max; i++)

	{

		if(i % 3 != 0 && i % 5 != 0)

		{

			sum = sum + i;

		}

	}

	printf("%lld", sum);

return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main()

{

	long long  n;

	cin>>n;

	long long  a[n+1];

	for(int i=1;i<=n;i++)

	a[i]=i;

	for(long long i=1;i<=n;i++)

	{

		if(a[i]%3==0||a[i]%5==0)

		a[i]=0;

	}

	long long sum=0;

	for(long long i=1;i<=n;i++)

	sum+=a[i];

	cout<<sum;

}

// Faster C++ solution for the same problem (measured speedup: 5.256904744525897x):
#include<stdio.h>



int main()

{

	long long int max,sum = 0;

	scanf("%lld", &max);

	for(int i = 0; i <= max; i++)

	{

		if(i % 3 != 0 && i % 5 != 0)

		{

			sum = sum + i;

		}

	}

	printf("%lld", sum);

return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cstdio>

#include<iomanip>

#include<algorithm>

#include<cstring>

#include<cmath>

#include<vector>

#include<map>

using namespace std;

string s[10005];

int main() 

{

	int n;

    cin>>n;

    long long ans=0;

    for (int i=1;i<=n;i++)

    {

        if (i%3==0)

        continue;

        else if (i%5==0)

        continue;

        else

        ans+=i;

    }

    cout<<ans<<endl;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 2.0918748370488767x):
#include<stdio.h>



int main()

{

	long long int max,sum = 0;

	scanf("%lld", &max);

	for(int i = 0; i <= max; i++)

	{

		if(i % 3 != 0 && i % 5 != 0)

		{

			sum = sum + i;

		}

	}

	printf("%lld", sum);

return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



#define forn(i, n) for (int i = 0; i < int(n); ++i)

#define for1(i, n) for (int i = 1; i <= int(n); ++i)

#define ms(a, x) memset(a, x, sizeof(a))

#define F first

#define S second

#define all(x) (x).begin(),(x).end()



using namespace std;

typedef long long ll;

typedef pair<int, int> pii;

const int INF = 0x3f3f3f3f;

mt19937 gen(random_device{}());

template<typename... Args> void write(Args... args) { ((cout << args << " "), ...); cout<<endl;}



int main() {

    ios::sync_with_stdio(false);

    cin.tie(nullptr);

    int n;

    cin>>n;

    ll sum=0;

    for1(i,n){

        if(i%3 and i%5) sum+=i;

    }

    cout<<sum;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 1.89902449573344x):
#include<stdio.h>



int main()

{

	long long int max,sum = 0;

	scanf("%lld", &max);

	for(int i = 0; i <= max; i++)

	{

		if(i % 3 != 0 && i % 5 != 0)

		{

			sum = sum + i;

		}

	}

	printf("%lld", sum);

return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



int main()

{

    long long n;

    cin>>n;

    long long count=0;

    for(long long i=1;i<=n;i++){

        if((i%3 == 0) && (i%5==0))

            {//cout<<"FizzBuzz\n";

            count+=i;}

        else if(i%3 == 0)

            {//cout<<"Fizz\n";

            count+=i;}

        else if(i%5 == 0)

            {//cout<<"Buzz\n";

            count+=i;}

     }

     cout<<(n*(n+1))/2-count<<endl;

    return 0;

}  

// Faster C++ solution for the same problem (measured speedup: 1.755359122262804x):
#include<stdio.h>



int main()

{

	long long int max,sum = 0;

	scanf("%lld", &max);

	for(int i = 0; i <= max; i++)

	{

		if(i % 3 != 0 && i % 5 != 0)

		{

			sum = sum + i;

		}

	}

	printf("%lld", sum);

return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

inline ll calc(ll x) {

	return (x+1)*x/2; 

}

int main() {

	ll n,ans;

	cin>>n;

	ans=calc(n)-calc(n/3)*3-calc(n/5)*5+calc(n/15)*15;

	cout<<ans<<endl;

	return 0;

} 

// Faster C++ solution for the same problem (measured speedup: 1.02741619474088x):
#include<stdio.h>



int main()

{

	long long int max,sum = 0;

	scanf("%lld", &max);

	for(int i = 0; i <= max; i++)

	{

		if(i % 3 != 0 && i % 5 != 0)

		{

			sum = sum + i;

		}

	}

	printf("%lld", sum);

return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cstdio>

#include<iomanip>

#include<algorithm>

#include<cstring>

#include<cmath>

#include<vector>

#include<map>

using namespace std;

string s[10005];

int main() 

{

	int n;

    cin>>n;

    long long ans=0;

    for (int i=1;i<=n;i++)

    {

        if (i%3==0)

        continue;

        else if (i%5==0)

        continue;

        else

        ans+=i;

    }

    cout<<ans<<endl;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 1.1820602037314605x):
#include<bits/stdc++.h>

using namespace std;

#define ll long long



int main()

{

    ios_base::sync_with_stdio(false);

	cin.tie(NULL);

	cout.tie(NULL);

    ll n;

    cin >> n;

    ll sum = 0;

    for (int i=1; i<=n; i++){

        if (i % 3 == 0 || i % 5 == 0){continue;}

        else {sum += i;}

    }

    cout << sum << endl;

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cstdio>

#include<iomanip>

#include<algorithm>

#include<cstring>

#include<cmath>

#include<vector>

#include<map>

using namespace std;

string s[10005];

int main() 

{

	int n;

    cin>>n;

    long long ans=0;

    for (int i=1;i<=n;i++)

    {

        if (i%3==0)

        continue;

        else if (i%5==0)

        continue;

        else

        ans+=i;

    }

    cout<<ans<<endl;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 1.133033187834322x):
	#include<bits/stdc++.h>

    using namespace std;

    #define 	ll 			long long

    #define 	w(t)		int t; cin>>t; while(t--)  

	#define 	AsmShuvo()  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

			

    int main()

    {

    AsmShuvo()

    	

    	ll N, sum=0, i;

		cin>>N;

			

		for(i=1; i<=N; i++){

		if(i%3 != 0 && i%5 != 0){

			sum = sum+i;

		    }

		}

		cout<<sum<<endl;

			



	}
// Slower C++ solution:
#include<iostream>

#include<cstdio>

#include<iomanip>

#include<algorithm>

#include<cstring>

#include<cmath>

#include<vector>

#include<map>

using namespace std;

string s[10005];

int main() 

{

	int n;

    cin>>n;

    long long ans=0;

    for (int i=1;i<=n;i++)

    {

        if (i%3==0)

        continue;

        else if (i%5==0)

        continue;

        else

        ans+=i;

    }

    cout<<ans<<endl;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 1.133033187834322x):
#include<iostream>

#include<string>

#include<algorithm>

#define LL long long

#define FIO ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)

using namespace std;



int main()

{

	FIO;

	LL n, sum=0; cin>>n;

	for(LL i=1; i<=n; i++) if(i%3!=0&&i%5!=0) sum+=i;

	cout<<sum<<endl;

}
// Slower C++ solution:
#include<iostream>

#include<cstdio>

#include<iomanip>

#include<algorithm>

#include<cstring>

#include<cmath>

#include<vector>

#include<map>

using namespace std;

string s[10005];

int main() 

{

	int n;

    cin>>n;

    long long ans=0;

    for (int i=1;i<=n;i++)

    {

        if (i%3==0)

        continue;

        else if (i%5==0)

        continue;

        else

        ans+=i;

    }

    cout<<ans<<endl;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 2.010248577594546x):
#include<bits/stdc++.h>

using namespace std;

long long int math(long long int x)

{

	long long int ans;

	ans=x*(x+1)/2;

	return ans;

}

int main()

{

	ios_base::sync_with_stdio(false);

	cin.tie(NULL);

	cout.tie(NULL);

	long long int ff,n,fv,th,total,totalff,totalfv,totalth,ans;

	cin>>n;

	total= math(n);

	ff=n/15;

	totalff=15*math(ff);

	th=(n/3);

	totalth=3*math(th);

	fv=(n/5);

	totalfv=5*math(fv);

	ans=total-totalfv-totalth+totalff;

	cout<<ans;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

	long long n,sum=0;

	cin>>n;

	for(int i=1;i<=n;i++){

		if(i%3==0 || i%5==0){

			continue;

		}

		else{

			sum+=i;

		}

	}

	cout<<sum;

}

// Faster C++ solution for the same problem (measured speedup: 1.7532545031507525x):
#include <stdio.h>

int main(){

	long long int n,sum=0;

	scanf("%ld",&n);

		for(int i=1;i<=n;i++){

		if(i%3 == 0 && i%5 ==0) continue;

		else if(i%3==0) continue;

		else if(i%5==0) continue;

		sum += i;

		}

			printf("%lld\n",sum);

 	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int N;

    long long int sum=0;

    scanf("%d",&N);

    for(long long int i=1;i<=N;i++)

    {

        if(i%3!=0 && i%5!=0 && (i%3!=0 && i%5!=0))

        {

            sum = sum + i;

        }

    }

    printf("%lld\n",sum);

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.7438988588564648x):
#include <stdio.h>

int main(){

	long long int n,sum=0;

	scanf("%ld",&n);

		for(int i=1;i<=n;i++){

		if(i%3 == 0 && i%5 ==0) continue;

		else if(i%3==0) continue;

		else if(i%5==0) continue;

		sum += i;

		}

			printf("%lld\n",sum);

 	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    long long unsigned i,N,sum=0;

    cin>>N;



    for(i=1;i<=N;i++){

        if(i%3!=0&&i%5!=0){

            sum=sum+i;

        }

    }

    cout<<sum<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.7548935509781116x):
#include <stdio.h>

int main(){

	long long int n,sum=0;

	scanf("%ld",&n);

		for(int i=1;i<=n;i++){

		if(i%3 == 0 && i%5 ==0) continue;

		else if(i%3==0) continue;

		else if(i%5==0) continue;

		sum += i;

		}

			printf("%lld\n",sum);

 	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#include <cstring>



#define pi 2*acos(0.00)

#define ll long long

#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define nl '\n'

#define null '\0'



using namespace std;



int main()

{

    fastio;



    ll n,i,sum=0;

    cin>>n;

    for(i=1;i<=n;i++)

    {

        if(i%3!=0&&i%5!=0)

        sum+=i;

    }    

    cout<<sum;

}

// Faster C++ solution for the same problem (measured speedup: 1.768475878333294x):
#include <stdio.h>

int main(){

	long long int n,sum=0;

	scanf("%ld",&n);

		for(int i=1;i<=n;i++){

		if(i%3 == 0 && i%5 ==0) continue;

		else if(i%3==0) continue;

		else if(i%5==0) continue;

		sum += i;

		}

			printf("%lld\n",sum);

 	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main()

{

	long long  n;

	cin>>n;

	long long  a[n+1];

	for(int i=1;i<=n;i++)

	a[i]=i;

	for(long long i=1;i<=n;i++)

	{

		if(a[i]%3==0||a[i]%5==0)

		a[i]=0;

	}

	long long sum=0;

	for(long long i=1;i<=n;i++)

	sum+=a[i];

	cout<<sum;

}

// Faster C++ solution for the same problem (measured speedup: 5.250067065054201x):
#include <stdio.h>

int main(){

	long long int n,sum=0;

	scanf("%ld",&n);

		for(int i=1;i<=n;i++){

		if(i%3 == 0 && i%5 ==0) continue;

		else if(i%3==0) continue;

		else if(i%5==0) continue;

		sum += i;

		}

			printf("%lld\n",sum);

 	return 0;

}