stablegradients/pie-gem5-pairs huggingface dataset:
// 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.1179283397749518x):
#include <stdio.h>



int main(){

    long long int n;

    scanf("%lld", &n);

    

    long long int sum = 0;

    

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

        if(i%15 && i%3 && i%5){

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



int main(){

    long long int n;

    scanf("%lld", &n);

    

    long long int sum = 0;

    

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

        if(i%15 && i%3 && i%5){

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



int main(){

	long long int a;

	long long int sum=0;

	scanf("%lld", &a);

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



int main(){

	long long int a;

	long long int sum=0;

	scanf("%lld", &a);

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



int main(){

	long long int a;

	long long int sum=0;

	scanf("%lld", &a);

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



int main(){

	long long int a;

	long long int sum=0;

	scanf("%lld", &a);

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



int main(){

	long long int a;

	long long int sum=0;

	scanf("%lld", &a);

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



int main(){

	long long int a;

	long long int sum=0;

	scanf("%lld", &a);

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



int main(){

	long long int a;

	long long int sum=0;

	scanf("%lld", &a);

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



int main(){

	long long int a;

	long long int sum=0;

	scanf("%lld", &a);

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



int main(){

	long long int a;

	long long int sum=0;

	scanf("%lld", &a);

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

 

int main(){

    

    long long n, sum = 0;

    scanf("%lld", &n);

    for(long long 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 n, sum = 0;

    scanf("%lld", &n);

    for(long long 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 n, sum = 0;

    scanf("%lld", &n);

    for(long long 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 n, sum = 0;

    scanf("%lld", &n);

    for(long long 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 n, sum = 0;

    scanf("%lld", &n);

    for(long long 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 n, sum = 0;

    scanf("%lld", &n);

    for(long long 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 n, sum = 0;

    scanf("%lld", &n);

    for(long long 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 n, sum = 0;

    scanf("%lld", &n);

    for(long long 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 n, sum = 0;

    scanf("%lld", &n);

    for(long long 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: 0.9161288352215902x):
#include <stdio.h>

int main(){

	

	int N;

	scanf("%d", &N);

	long long int sum=0;

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

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

			

		} else {

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

int main(){

	

	int N;

	scanf("%d", &N);

	long long int sum=0;

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

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

			

		} else {

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

int main(){

	

	int N;

	scanf("%d", &N);

	long long int sum=0;

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

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

			

		} else {

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

int main(){

	

	int N;

	scanf("%d", &N);

	long long int sum=0;

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

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

			

		} else {

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

int main(){

	

	int N;

	scanf("%d", &N);

	long long int sum=0;

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

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

			

		} else {

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

int main(){

	

	int N;

	scanf("%d", &N);

	long long int sum=0;

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

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

			

		} else {

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

int main(){

	

	int N;

	scanf("%d", &N);

	long long int sum=0;

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

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

			

		} else {

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

int main(){

	

	int N;

	scanf("%d", &N);

	long long int sum=0;

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

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

			

		} else {

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

int main(){

	

	int N;

	scanf("%d", &N);

	long long int sum=0;

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

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

			

		} else {

			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;



	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()

{

    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;



	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 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;



	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>

#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;



	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<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;



	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<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;



	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;

}