stablegradients/pie-gem5-pairs huggingface dataset:
// 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;



	scanf ("%d",&n);

	long long int out=0;

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

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

		}

		else {

			out+=i;

		}

	}

	

	printf ("%lld",out);

	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.9007580652821707x):
#include <stdio.h>



int main (){

	int n;



	scanf ("%d",&n);

	long long int out=0;

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

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

		}

		else {

			out+=i;

		}

	}

	

	printf ("%lld",out);

	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.1125185688714416x):
#include <stdio.h>



int main (){

	int n;



	scanf ("%d",&n);

	long long int out=0;

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

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

		}

		else {

			out+=i;

		}

	}

	

	printf ("%lld",out);

	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.6881184454259959x):
#include <stdio.h>

int main(){

	long long int sum = 0;

	int n;

	scanf("%d" , &n);

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

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

			continue;

		}

		else if(i%3 == 0){

			continue;

		}

		else if(i%5 == 0){

			continue;

		}

		else{

			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.679110377473711x):
#include <stdio.h>

int main(){

	long long int sum = 0;

	int n;

	scanf("%d" , &n);

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

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

			continue;

		}

		else if(i%3 == 0){

			continue;

		}

		else if(i%5 == 0){

			continue;

		}

		else{

			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.6896966001464475x):
#include <stdio.h>

int main(){

	long long int sum = 0;

	int n;

	scanf("%d" , &n);

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

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

			continue;

		}

		else if(i%3 == 0){

			continue;

		}

		else if(i%5 == 0){

			continue;

		}

		else{

			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.70277432348832x):
#include <stdio.h>

int main(){

	long long int sum = 0;

	int n;

	scanf("%d" , &n);

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

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

			continue;

		}

		else if(i%3 == 0){

			continue;

		}

		else if(i%5 == 0){

			continue;

		}

		else{

			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.243260612388809x):
#include <stdio.h>

int main(){

	long long int sum = 0;

	int n;

	scanf("%d" , &n);

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

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

			continue;

		}

		else if(i%3 == 0){

			continue;

		}

		else if(i%5 == 0){

			continue;

		}

		else{

			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.0136946060354894x):
#include <stdio.h>

int main(){

	long long int sum = 0;

	int n;

	scanf("%d" , &n);

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

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

			continue;

		}

		else if(i%3 == 0){

			continue;

		}

		else if(i%5 == 0){

			continue;

		}

		else{

			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: 1.8280517151697755x):
#include <stdio.h>

int main(){

	long long int sum = 0;

	int n;

	scanf("%d" , &n);

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

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

			continue;

		}

		else if(i%3 == 0){

			continue;

		}

		else if(i%5 == 0){

			continue;

		}

		else{

			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.6897555884091406x):
#include <stdio.h>

int main(){

	long long int sum = 0;

	int n;

	scanf("%d" , &n);

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

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

			continue;

		}

		else if(i%3 == 0){

			continue;

		}

		else if(i%5 == 0){

			continue;

		}

		else{

			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: 0.9890182781785993x):
#include <stdio.h>

int main(){

	long long int sum = 0;

	int n;

	scanf("%d" , &n);

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

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

			continue;

		}

		else if(i%3 == 0){

			continue;

		}

		else if(i%5 == 0){

			continue;

		}

		else{

			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.8982242016082636x):
#include<stdio.h>

 

int main(){

	int A, i;

	scanf("%d", &A);

	long long int sum = 0;

	for (i = 1; i <= A; 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.8880949759943322x):
#include<stdio.h>

 

int main(){

	int A, i;

	scanf("%d", &A);

	long long int sum = 0;

	for (i = 1; i <= A; 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.8999987758345924x):
#include<stdio.h>

 

int main(){

	int A, i;

	scanf("%d", &A);

	long long int sum = 0;

	for (i = 1; i <= A; 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.9147041722578957x):
#include<stdio.h>

 

int main(){

	int A, i;

	scanf("%d", &A);

	long long int sum = 0;

	for (i = 1; i <= A; 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.244074843638035x):
#include<stdio.h>

 

int main(){

	int A, i;

	scanf("%d", &A);

	long long int sum = 0;

	for (i = 1; i <= A; 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.264322059972511x):
#include<stdio.h>

 

int main(){

	int A, i;

	scanf("%d", &A);

	long long int sum = 0;

	for (i = 1; i <= A; 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.055573776193825x):
#include<stdio.h>

 

int main(){

	int A, i;

	scanf("%d", &A);

	long long int sum = 0;

	for (i = 1; i <= A; 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.9000651058650226x):
#include<stdio.h>

 

int main(){

	int A, i;

	scanf("%d", &A);

	long long int sum = 0;

	for (i = 1; i <= A; 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.11211297794794x):
#include<stdio.h>

 

int main(){

	int A, i;

	scanf("%d", &A);

	long long int sum = 0;

	for (i = 1; i <= A; 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.8989164896421327x):
#include <stdio.h>

int main ()

{

	int n;

	long long int sum = 0;

	scanf ("%d", &n);

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

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

			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.888783569869377x):
#include <stdio.h>

int main ()

{

	int n;

	long long int sum = 0;

	scanf ("%d", &n);

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

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

			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.9006917110609802x):
#include <stdio.h>

int main ()

{

	int n;

	long long int sum = 0;

	scanf ("%d", &n);

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

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

			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.9154024705862651x):
#include <stdio.h>

int main ()

{

	int n;

	long long int sum = 0;

	scanf ("%d", &n);

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

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

			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.253369850089034x):
#include <stdio.h>

int main ()

{

	int n;

	long long int sum = 0;

	scanf ("%d", &n);

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

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

			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.2651478649883865x):
#include <stdio.h>

int main ()

{

	int n;

	long long int sum = 0;

	scanf ("%d", &n);

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

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

			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: 2.056323450087345x):
#include <stdio.h>

int main ()

{

	int n;

	long long int sum = 0;

	scanf ("%d", &n);

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

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

			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.9007580652821707x):
#include <stdio.h>

int main ()

{

	int n;

	long long int sum = 0;

	scanf ("%d", &n);

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

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

			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.1125185688714416x):
#include <stdio.h>

int main ()

{

	int n;

	long long int sum = 0;

	scanf ("%d", &n);

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

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

			sum += i;

		}

	}

	printf ("%lld", 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.8989164896421327x):
#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()

{

    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.888783569869377x):
#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 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.9006917110609802x):
#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);

		

}