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

using namespace std;

int main()

{

   int n; cin >> n;

   long long sum =0;

   int p = n+1;

   while(p--)

   {

       if (p%5==0 || p%3 == 0){/*do nth */}

       else {sum += p;}

   }

   cout << sum <<endl;

    return 0;

}




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

 

int main(){

	long long int n, sum = 0;

	scanf("%lld", &n);

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

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

			continue;

		}

		else {

			sum+=i;

		}

	}

	printf("%lld", sum);

	

	return 0;

}
// Slower C++ solution:
#define GODSPEED ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);

#define pb push_back

#define f(i,x,n) for(i=x;i<n;i++)

#define rf(i,x,n) for(i=n;i>x;i--)

#define ll long long

#define GCD(a,b) __gcd(a,b)

#define adios return 0;



/*

SHERAJUL ARIFIN

Dept. of CSE,

IUT.

*/





#include <bits/stdc++.h>

using namespace std;



int main()

{

    GODSPEED;

    ll t,n,a,b,c,d,s=0,i,j,flag;

    cin>>n;

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

    {

        if(i%15!=0 and i%3!=0 and i%5!=0) s+=i;

    }

    cout<<s<<endl;







    adios;

}


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

 

int main(){

	long long int n, sum = 0;

	scanf("%lld", &n);

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

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

			continue;

		}

		else {

			sum+=i;

		}

	}

	printf("%lld", sum);

	

	return 0;

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

#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

using namespace std;

	const int maxn=55;

	int a[maxn][maxn];

	int n;

	int main(){

		IOS

		cin>>n;

		long long ans=0;

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

			if(i%3&&i%5)

				ans+=i;

		}

		cout<<ans<<endl;

		return 0;

	} 

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

 

int main(){

	long long int n, sum = 0;

	scanf("%lld", &n);

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

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

			continue;

		}

		else {

			sum+=i;

		}

	}

	printf("%lld", sum);

	

	return 0;

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

using namespace std;



 int main()

 {

 	int n;

 	cin>>n;

 	long long sum = 0;

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

 		if(i%3 != 0 && i%5 != 0) sum += i;

	}

	cout<<sum<<endl;

 	return 0;

 }

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

 

int main(){

	long long int n, sum = 0;

	scanf("%lld", &n);

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

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

			continue;

		}

		else {

			sum+=i;

		}

	}

	printf("%lld", sum);

	

	return 0;

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

#include<algorithm>

#include<cmath>

#include<cstdlib>

#include<cstdio>

#include<cstring>

#include<iomanip>

#include<string>

#include<set>

#include<map>

#include<vector>

#include<queue>

#include<stack>

#include<utility>

#define PI acos(-1.0)

typedef long long ll;

using namespace std;

int main(){

	ll ans = 0,n;

	cin >> n;

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

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

			ans += i;

		}

	}

	cout << ans << endl;

	return 0;

}

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

 

int main(){

	long long int n, sum = 0;

	scanf("%lld", &n);

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

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

			continue;

		}

		else {

			sum+=i;

		}

	}

	printf("%lld", sum);

	

	return 0;

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



using namespace std;



int main(){

	long long int n; cin >> n;

	long long int res = 0;

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

		if(i % 3 == 0){

			

		}else if(i % 5 == 0){

			

		}else{

			res += i;

		}

	}

	

	cout << res << "\n";

	return 0;

}


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

 

int main(){

	long long int n, sum = 0;

	scanf("%lld", &n);

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

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

			continue;

		}

		else {

			sum+=i;

		}

	}

	printf("%lld", sum);

	

	return 0;

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



using namespace std;



int main(){

    int n;

    cin>>n;

    long long int s=0;

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

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

            s+=i;

        }

    }

    cout<<s;

    return 0;

}

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

 

int main(){

	long long int n, sum = 0;

	scanf("%lld", &n);

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

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

			continue;

		}

		else {

			sum+=i;

		}

	}

	printf("%lld", sum);

	

	return 0;

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

using namespace std;

typedef long long ll;

int main()

{

    ll n;  cin>>n;

    ll sum=0;

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

    {

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

            continue;

        sum+=i;

    }

    cout<<sum;

    return 0;

}


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

 

int main(){

	long long int n, sum = 0;

	scanf("%lld", &n);

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

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

			continue;

		}

		else {

			sum+=i;

		}

	}

	printf("%lld", sum);

	

	return 0;

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

using namespace std;

typedef long long ll;

int  main(){

	ll n,ans=0;

	cin>>n;

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

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

		else ans+=i; 

	}

	cout<<ans<<endl;

}

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

 

int main(){

	long long int n, sum = 0;

	scanf("%lld", &n);

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

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

			continue;

		}

		else {

			sum+=i;

		}

	}

	printf("%lld", sum);

	

	return 0;

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

using namespace std;

int main(){

    long long n,ans=0;

    cin>>n;

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

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

            ans+=i;

        }

    }

    cout<<ans;

}


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

 

int main(){

	long long int n, sum = 0;

	scanf("%lld", &n);

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

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

			continue;

		}

		else {

			sum+=i;

		}

	}

	printf("%lld", sum);

	

	return 0;

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

using namespace std;

int main()

{

         long long c=0,i,n,f=0,b=0;

         cin>>n;

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

        {

           b+=i;

           if((i%3)==0 || (i%5)==0) {f+=i;

           }

         }

 

         cout<<b-f<<endl;

}

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

 

int main(){

	long long int n, sum = 0;

	scanf("%lld", &n);

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

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

			continue;

		}

		else {

			sum+=i;

		}

	}

	printf("%lld", sum);

	

	return 0;

}
// Slower C++ solution:
// In the name of God



#include <bits/stdc++.h>



using namespace std;



int main() {

	ios_base::sync_with_stdio(false);

	cin.tie(0);



	int n;

	cin >> n;



	long long ans = 0;

	

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

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

		ans += i;

	}

	cout << ans;



	return 0;

}


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

 

int main(){

	long long int n, sum = 0;

	scanf("%lld", &n);

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

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

			continue;

		}

		else {

			sum+=i;

		}

	}

	printf("%lld", sum);

	

	return 0;

}
// Slower C++ solution:
#include<iostream>   //AA06( 21/ 04/ 20) If u see my code, Have a Good Day! (^_^)



using namespace std;



int main()

{

    long long int N, i, sum = 0;



    cin >> N;



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



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

            continue;

        }



        sum = sum + i;





    }



    cout << sum << endl;



    return 0;

}


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



int main(){

	

	long long int N, sum = 0;

	scanf("%lld", &N);

	

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

		if(i%3 == 0){

		}

		else if(i%5 == 0){

		}

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

		}

		else{

			sum+= i;

		}

	}

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

	return 0;

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

using namespace std;

int main()

{

   int n; cin >> n;

   long long sum =0;

   int p = n+1;

   while(p--)

   {

       if (p%5==0 || p%3 == 0){/*do nth */}

       else {sum += p;}

   }

   cout << sum <<endl;

    return 0;

}




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



int main(){

	

	long long int N, sum = 0;

	scanf("%lld", &N);

	

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

		if(i%3 == 0){

		}

		else if(i%5 == 0){

		}

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

		}

		else{

			sum+= i;

		}

	}

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

	return 0;

}
// Slower C++ solution:
#define GODSPEED ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);

#define pb push_back

#define f(i,x,n) for(i=x;i<n;i++)

#define rf(i,x,n) for(i=n;i>x;i--)

#define ll long long

#define GCD(a,b) __gcd(a,b)

#define adios return 0;



/*

SHERAJUL ARIFIN

Dept. of CSE,

IUT.

*/





#include <bits/stdc++.h>

using namespace std;



int main()

{

    GODSPEED;

    ll t,n,a,b,c,d,s=0,i,j,flag;

    cin>>n;

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

    {

        if(i%15!=0 and i%3!=0 and i%5!=0) s+=i;

    }

    cout<<s<<endl;







    adios;

}


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



int main(){

	

	long long int N, sum = 0;

	scanf("%lld", &N);

	

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

		if(i%3 == 0){

		}

		else if(i%5 == 0){

		}

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

		}

		else{

			sum+= i;

		}

	}

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

	return 0;

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

#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

using namespace std;

	const int maxn=55;

	int a[maxn][maxn];

	int n;

	int main(){

		IOS

		cin>>n;

		long long ans=0;

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

			if(i%3&&i%5)

				ans+=i;

		}

		cout<<ans<<endl;

		return 0;

	} 

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



int main(){

	

	long long int N, sum = 0;

	scanf("%lld", &N);

	

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

		if(i%3 == 0){

		}

		else if(i%5 == 0){

		}

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

		}

		else{

			sum+= i;

		}

	}

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

	return 0;

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

using namespace std;



 int main()

 {

 	int n;

 	cin>>n;

 	long long sum = 0;

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

 		if(i%3 != 0 && i%5 != 0) sum += i;

	}

	cout<<sum<<endl;

 	return 0;

 }

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



int main(){

	

	long long int N, sum = 0;

	scanf("%lld", &N);

	

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

		if(i%3 == 0){

		}

		else if(i%5 == 0){

		}

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

		}

		else{

			sum+= i;

		}

	}

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

	return 0;

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

#include<algorithm>

#include<cmath>

#include<cstdlib>

#include<cstdio>

#include<cstring>

#include<iomanip>

#include<string>

#include<set>

#include<map>

#include<vector>

#include<queue>

#include<stack>

#include<utility>

#define PI acos(-1.0)

typedef long long ll;

using namespace std;

int main(){

	ll ans = 0,n;

	cin >> n;

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

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

			ans += i;

		}

	}

	cout << ans << endl;

	return 0;

}

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



int main(){

	

	long long int N, sum = 0;

	scanf("%lld", &N);

	

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

		if(i%3 == 0){

		}

		else if(i%5 == 0){

		}

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

		}

		else{

			sum+= i;

		}

	}

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

	return 0;

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



using namespace std;



int main(){

	long long int n; cin >> n;

	long long int res = 0;

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

		if(i % 3 == 0){

			

		}else if(i % 5 == 0){

			

		}else{

			res += i;

		}

	}

	

	cout << res << "\n";

	return 0;

}


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



int main(){

	

	long long int N, sum = 0;

	scanf("%lld", &N);

	

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

		if(i%3 == 0){

		}

		else if(i%5 == 0){

		}

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

		}

		else{

			sum+= i;

		}

	}

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

	return 0;

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



using namespace std;



int main(){

    int n;

    cin>>n;

    long long int s=0;

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

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

            s+=i;

        }

    }

    cout<<s;

    return 0;

}

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



int main(){

	

	long long int N, sum = 0;

	scanf("%lld", &N);

	

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

		if(i%3 == 0){

		}

		else if(i%5 == 0){

		}

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

		}

		else{

			sum+= i;

		}

	}

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

	return 0;

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

using namespace std;

typedef long long ll;

int main()

{

    ll n;  cin>>n;

    ll sum=0;

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

    {

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

            continue;

        sum+=i;

    }

    cout<<sum;

    return 0;

}


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



int main(){

	

	long long int N, sum = 0;

	scanf("%lld", &N);

	

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

		if(i%3 == 0){

		}

		else if(i%5 == 0){

		}

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

		}

		else{

			sum+= i;

		}

	}

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

	return 0;

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

using namespace std;

typedef long long ll;

int  main(){

	ll n,ans=0;

	cin>>n;

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

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

		else ans+=i; 

	}

	cout<<ans<<endl;

}

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



int main(){

	

	long long int N, sum = 0;

	scanf("%lld", &N);

	

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

		if(i%3 == 0){

		}

		else if(i%5 == 0){

		}

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

		}

		else{

			sum+= i;

		}

	}

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

	return 0;

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

using namespace std;

int main(){

    long long n,ans=0;

    cin>>n;

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

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

            ans+=i;

        }

    }

    cout<<ans;

}


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



int main(){

	

	long long int N, sum = 0;

	scanf("%lld", &N);

	

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

		if(i%3 == 0){

		}

		else if(i%5 == 0){

		}

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

		}

		else{

			sum+= i;

		}

	}

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

	return 0;

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

using namespace std;

int main()

{

         long long c=0,i,n,f=0,b=0;

         cin>>n;

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

        {

           b+=i;

           if((i%3)==0 || (i%5)==0) {f+=i;

           }

         }

 

         cout<<b-f<<endl;

}

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



int main(){

	

	long long int N, sum = 0;

	scanf("%lld", &N);

	

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

		if(i%3 == 0){

		}

		else if(i%5 == 0){

		}

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

		}

		else{

			sum+= i;

		}

	}

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

	return 0;

}
// Slower C++ solution:
// In the name of God



#include <bits/stdc++.h>



using namespace std;



int main() {

	ios_base::sync_with_stdio(false);

	cin.tie(0);



	int n;

	cin >> n;



	long long ans = 0;

	

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

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

		ans += i;

	}

	cout << ans;



	return 0;

}


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



int main(){

	

	long long int N, sum = 0;

	scanf("%lld", &N);

	

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

		if(i%3 == 0){

		}

		else if(i%5 == 0){

		}

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

		}

		else{

			sum+= i;

		}

	}

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

	return 0;

}
// Slower C++ solution:
#include<iostream>   //AA06( 21/ 04/ 20) If u see my code, Have a Good Day! (^_^)



using namespace std;



int main()

{

    long long int N, i, sum = 0;



    cin >> N;



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



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

            continue;

        }



        sum = sum + i;





    }



    cout << sum << endl;



    return 0;

}


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



int main(){

	long long N, sum;

	scanf("%lld", &N);

	sum = N*(N+1)/2;



	long long Un3 = N/3;

	long long Sn3 = 3*(Un3*(Un3+1)/2);

	

	long long Un5 = N/5;

	long long Sn5 = 5*(Un5*(Un5+1)/2);

	

	long long Un15 = N/15;

	long long Sn15 = 15*(Un15*(Un15+1)/2);



	printf("%lld", sum-Sn3-Sn5+Sn15);

			

	return 0;

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

using namespace std;

int main()

{

   int n; cin >> n;

   long long sum =0;

   int p = n+1;

   while(p--)

   {

       if (p%5==0 || p%3 == 0){/*do nth */}

       else {sum += p;}

   }

   cout << sum <<endl;

    return 0;

}




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



int main(){

	long long N, sum;

	scanf("%lld", &N);

	sum = N*(N+1)/2;



	long long Un3 = N/3;

	long long Sn3 = 3*(Un3*(Un3+1)/2);

	

	long long Un5 = N/5;

	long long Sn5 = 5*(Un5*(Un5+1)/2);

	

	long long Un15 = N/15;

	long long Sn15 = 15*(Un15*(Un15+1)/2);



	printf("%lld", sum-Sn3-Sn5+Sn15);

			

	return 0;

}
// Slower C++ solution:
#define GODSPEED ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);

#define pb push_back

#define f(i,x,n) for(i=x;i<n;i++)

#define rf(i,x,n) for(i=n;i>x;i--)

#define ll long long

#define GCD(a,b) __gcd(a,b)

#define adios return 0;



/*

SHERAJUL ARIFIN

Dept. of CSE,

IUT.

*/





#include <bits/stdc++.h>

using namespace std;



int main()

{

    GODSPEED;

    ll t,n,a,b,c,d,s=0,i,j,flag;

    cin>>n;

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

    {

        if(i%15!=0 and i%3!=0 and i%5!=0) s+=i;

    }

    cout<<s<<endl;







    adios;

}


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



int main(){

	long long N, sum;

	scanf("%lld", &N);

	sum = N*(N+1)/2;



	long long Un3 = N/3;

	long long Sn3 = 3*(Un3*(Un3+1)/2);

	

	long long Un5 = N/5;

	long long Sn5 = 5*(Un5*(Un5+1)/2);

	

	long long Un15 = N/15;

	long long Sn15 = 15*(Un15*(Un15+1)/2);



	printf("%lld", sum-Sn3-Sn5+Sn15);

			

	return 0;

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

#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

using namespace std;

	const int maxn=55;

	int a[maxn][maxn];

	int n;

	int main(){

		IOS

		cin>>n;

		long long ans=0;

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

			if(i%3&&i%5)

				ans+=i;

		}

		cout<<ans<<endl;

		return 0;

	} 

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



int main(){

	long long N, sum;

	scanf("%lld", &N);

	sum = N*(N+1)/2;



	long long Un3 = N/3;

	long long Sn3 = 3*(Un3*(Un3+1)/2);

	

	long long Un5 = N/5;

	long long Sn5 = 5*(Un5*(Un5+1)/2);

	

	long long Un15 = N/15;

	long long Sn15 = 15*(Un15*(Un15+1)/2);



	printf("%lld", sum-Sn3-Sn5+Sn15);

			

	return 0;

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

using namespace std;



 int main()

 {

 	int n;

 	cin>>n;

 	long long sum = 0;

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

 		if(i%3 != 0 && i%5 != 0) sum += i;

	}

	cout<<sum<<endl;

 	return 0;

 }

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



int main(){

	long long N, sum;

	scanf("%lld", &N);

	sum = N*(N+1)/2;



	long long Un3 = N/3;

	long long Sn3 = 3*(Un3*(Un3+1)/2);

	

	long long Un5 = N/5;

	long long Sn5 = 5*(Un5*(Un5+1)/2);

	

	long long Un15 = N/15;

	long long Sn15 = 15*(Un15*(Un15+1)/2);



	printf("%lld", sum-Sn3-Sn5+Sn15);

			

	return 0;

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

#include<algorithm>

#include<cmath>

#include<cstdlib>

#include<cstdio>

#include<cstring>

#include<iomanip>

#include<string>

#include<set>

#include<map>

#include<vector>

#include<queue>

#include<stack>

#include<utility>

#define PI acos(-1.0)

typedef long long ll;

using namespace std;

int main(){

	ll ans = 0,n;

	cin >> n;

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

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

			ans += i;

		}

	}

	cout << ans << endl;

	return 0;

}

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



int main(){

	long long N, sum;

	scanf("%lld", &N);

	sum = N*(N+1)/2;



	long long Un3 = N/3;

	long long Sn3 = 3*(Un3*(Un3+1)/2);

	

	long long Un5 = N/5;

	long long Sn5 = 5*(Un5*(Un5+1)/2);

	

	long long Un15 = N/15;

	long long Sn15 = 15*(Un15*(Un15+1)/2);



	printf("%lld", sum-Sn3-Sn5+Sn15);

			

	return 0;

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



using namespace std;



int main(){

	long long int n; cin >> n;

	long long int res = 0;

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

		if(i % 3 == 0){

			

		}else if(i % 5 == 0){

			

		}else{

			res += i;

		}

	}

	

	cout << res << "\n";

	return 0;

}


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



int main(){

	long long N, sum;

	scanf("%lld", &N);

	sum = N*(N+1)/2;



	long long Un3 = N/3;

	long long Sn3 = 3*(Un3*(Un3+1)/2);

	

	long long Un5 = N/5;

	long long Sn5 = 5*(Un5*(Un5+1)/2);

	

	long long Un15 = N/15;

	long long Sn15 = 15*(Un15*(Un15+1)/2);



	printf("%lld", sum-Sn3-Sn5+Sn15);

			

	return 0;

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



using namespace std;



int main(){

    int n;

    cin>>n;

    long long int s=0;

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

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

            s+=i;

        }

    }

    cout<<s;

    return 0;

}

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



int main(){

	long long N, sum;

	scanf("%lld", &N);

	sum = N*(N+1)/2;



	long long Un3 = N/3;

	long long Sn3 = 3*(Un3*(Un3+1)/2);

	

	long long Un5 = N/5;

	long long Sn5 = 5*(Un5*(Un5+1)/2);

	

	long long Un15 = N/15;

	long long Sn15 = 15*(Un15*(Un15+1)/2);



	printf("%lld", sum-Sn3-Sn5+Sn15);

			

	return 0;

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

using namespace std;

typedef long long ll;

int main()

{

    ll n;  cin>>n;

    ll sum=0;

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

    {

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

            continue;

        sum+=i;

    }

    cout<<sum;

    return 0;

}


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



int main(){

	long long N, sum;

	scanf("%lld", &N);

	sum = N*(N+1)/2;



	long long Un3 = N/3;

	long long Sn3 = 3*(Un3*(Un3+1)/2);

	

	long long Un5 = N/5;

	long long Sn5 = 5*(Un5*(Un5+1)/2);

	

	long long Un15 = N/15;

	long long Sn15 = 15*(Un15*(Un15+1)/2);



	printf("%lld", sum-Sn3-Sn5+Sn15);

			

	return 0;

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

using namespace std;

typedef long long ll;

int  main(){

	ll n,ans=0;

	cin>>n;

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

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

		else ans+=i; 

	}

	cout<<ans<<endl;

}

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



int main(){

	long long N, sum;

	scanf("%lld", &N);

	sum = N*(N+1)/2;



	long long Un3 = N/3;

	long long Sn3 = 3*(Un3*(Un3+1)/2);

	

	long long Un5 = N/5;

	long long Sn5 = 5*(Un5*(Un5+1)/2);

	

	long long Un15 = N/15;

	long long Sn15 = 15*(Un15*(Un15+1)/2);



	printf("%lld", sum-Sn3-Sn5+Sn15);

			

	return 0;

}