stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<cstdio>

#include<cmath>

#include<iostream>

#include<algorithm>

#include<cstring>

#include<cstdlib>

#include<queue>

#include<map>

#include<stack>

#include<set>

#include<vector>

#include<functional>

using namespace std;

typedef long long LL;

inline LL read()

{

	LL kk=0,f=1;

	char cc=getchar();

	while(cc<'0'||cc>'9'){if(cc=='-')f=-1;cc=getchar();}

	while(cc>='0'&&cc<='9'){kk=(kk<<1)+(kk<<3)+cc-'0';cc=getchar();}

	return kk*f;

}

bool vis[2000222];int n;

int main()

{

	n=read();

	for(int i=1;i<=n/5+10;++i)vis[i*5]=1;

	for(int i=1;i<=n/3+10;++i)vis[i*3]=1;

	LL asd=0;

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

	{

		if(!vis[i])asd+=i;

	}

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

}

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



int main (){

	int a;

	long long int total = 0;

	scanf("%d", &a);

	

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

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

			printf("");

		}

		else if (i % 3 ==0){

			printf("");

		}

		else if (i%5==0){

			printf("");

		}

		else{

			total = total + i;

		}

	}

	

	printf("%lld", total);

	return 0;

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

using namespace std;

#define elif else if

typedef long long ll;

typedef unsigned long long ull;

#define DEBUG(x) cout<<(x)<<endl



int main()

{

    ll n;

    scanf("%lld", &n);

    ll ans = 0;

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

    {

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

        {

            // puts("FizzBuzz");

            ;

        }

        elif(i%3==0)

        {

            // puts("Fizz");

            ;

        }

        elif(i%5==0)

        {

            // puts("Buzz");

            ;

        }

        else

        {

            ans += i;

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

        }

    }

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

    

    return 0;

}


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



int main (){

	int a;

	long long int total = 0;

	scanf("%d", &a);

	

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

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

			printf("");

		}

		else if (i % 3 ==0){

			printf("");

		}

		else if (i%5==0){

			printf("");

		}

		else{

			total = total + i;

		}

	}

	

	printf("%lld", total);

	return 0;

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

using namespace std;

long long n;

long long ans;

int main(){

	cin>>n;

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

		if (i%3==0){

			continue;

		}

		if (i%5==0){

			continue;

		}

		ans+=i;

	}

	cout<<ans<<endl;

	return 0;

}

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



int main (){

	int a;

	long long int total = 0;

	scanf("%d", &a);

	

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

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

			printf("");

		}

		else if (i % 3 ==0){

			printf("");

		}

		else if (i%5==0){

			printf("");

		}

		else{

			total = total + i;

		}

	}

	

	printf("%lld", total);

	return 0;

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

using namespace std;



int main()

{

     int n,i;

     long long  sum=0;



     cin>>n;



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

     {

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

               sum=sum;

          else if(i%3==0)

               sum==sum;

          else if(i%5==0)

               sum==sum;

               else

                    sum+=i;



     }

     cout<<sum<<endl;

}


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



int main (){

	int a;

	long long int total = 0;

	scanf("%d", &a);

	

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

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

			printf("");

		}

		else if (i % 3 ==0){

			printf("");

		}

		else if (i%5==0){

			printf("");

		}

		else{

			total = total + i;

		}

	}

	

	printf("%lld", total);

	return 0;

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

#define mp make_pair

#define ff first

#define ss second

#define pb push_back

#define w(x) scanf("%d",&x);while(x--)

#define rep(i,a,b) for(i=a;i<=b;i++)

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

#define pi 2*acos(0.0)

using namespace std;

typedef long long ll;

typedef pair<ll,ll> pll;

typedef vector<int> vi;



long long int mod=1e9+9;

const int N=100000;

int t,i,j,cs=0,n,a,b;

string s;



int main()

{

    long long n;

    cin>>n;

    long long ans=n*(n+1)/2 ;

     long long a=n;

     n/=3;

     ans-=3*n*(n+1)/2;

     n=a/5;

     ans-=5*n*(n+1)/2;

     n=a/15;

     ans+=15*n*(n+1)/2;

    cout<<ans<<endl;

}






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



int main (){

	int a;

	long long int total = 0;

	scanf("%d", &a);

	

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

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

			printf("");

		}

		else if (i % 3 ==0){

			printf("");

		}

		else if (i%5==0){

			printf("");

		}

		else{

			total = total + i;

		}

	}

	

	printf("%lld", total);

	return 0;

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

using namespace std;

 

//Made with <3 by MinumCoklatPanas

typedef long long ll;

const int INF = 1e9;

const ll INFF = 1e18;

const int MAXN = 510;

const int MOD = 1e9 + 7;

const double PI = acos(-1.0);

const double INFD = 1E9;

const double EPS = 1e-9;



int main()

{

	ios_base::sync_with_stdio(false);

	cin.tie(0);

	cout.tie(0);

	int n;

	cin >> n;

	ll ans = 0;

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

	{

		if (__gcd(i,15) == 1)

			ans += i;

	}

	cout << ans << endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.329193873031256x):
#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)

		{

			continue;

		}

		else

		{

			sum+=i;

		}

	}

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

	return 0;

}
// Slower C++ solution:
///HELLO THERE~!

///CREATED BY MD SADMAN MEHEDI SIVAN(IUT CSE-SWE^19)



#include <bits/stdc++.h>



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

#define read freopen("blue.txt","r",stdin);

#define write freopen("red.txt","w",stdout);

#define pie 2*acos(0.0);



typedef long long ll;



using namespace std;





int main()



{



    fastio;



    long long N;

    cin>>N;



    long long totalsum=0;



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

    {

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

            continue;



        totalsum=totalsum+i;



    }

    cout<<totalsum;

    return 0;



}


// Faster C++ solution for the same problem (measured speedup: 2.727606137695818x):
#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)

		{

			continue;

		}

		else

		{

			sum+=i;

		}

	}

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

	return 0;

}
// Slower C++ solution:
/*    Mohammed Sami Khan

                       মোহাম্মদ সামী খান

*/

#include<bits/stdc++.h>

using namespace std;

#define pi acos(-1.0)

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

typedef long long ll;

typedef unsigned long long ull;



int main()

{

    fastio;

    ll t, n, m, i, p, q, r, sum=0, a, b, c, d, f=0;

    char *ye="YES", *no="NO";

    cin>>m;

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

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

        sum+=i;

    }

    cout<<sum<<endl;

}


// Faster C++ solution for the same problem (measured speedup: 1.9982193440753107x):
#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)

		{

			continue;

		}

		else

		{

			sum+=i;

		}

	}

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

	return 0;

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

using namespace std;

int main()

{

      ios_base::sync_with_stdio(false);

      long long int n,k,a,b=0,c,m,i,j,p,q;

      cin>>n;

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

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

      }

      cout<<b;

      return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.913893201101849x):
#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)

		{

			continue;

		}

		else

		{

			sum+=i;

		}

	}

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

	return 0;

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

using namespace std;

typedef long long ll;



signed main()

{

	int n;

	cin>>n;

	ll cnt=0;

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

		if(i%3&&i%5)cnt+=i;

	}

	cout<<cnt<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.900501004624083x):
#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)

		{

			continue;

		}

		else

		{

			sum+=i;

		}

	}

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

	return 0;

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

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)

        {

            sum+=i;

        }

    }

    cout<<sum<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.9000886956518146x):
#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)

		{

			continue;

		}

		else

		{

			sum+=i;

		}

	}

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

	return 0;

}
// Slower C++ solution:


#include <bits/stdc++.h>

#define FRU                                  freopen("out.txt","w",stdout);

#define FRO                                  freopen("in.txt","r",stdin);

#define pb                                   push_back

#define pf                                   push_front

#define ppb                                  pop_back()

#define ppf                                  pop_front()

#define mp                                   make_pair

#define ff                                   first

#define ss                                   second

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

#define mem(ara,n)                           memset(ara,n,sizeof ara)

#define fr(i,j,n)                            for(i=j;i<n;i++)

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

#define inf                                  2147483647

#define ll                                   long long

#define ull                                  unsigned long long

#define pii                                  pair<int,int>

#define vi                                   vector<int>

#define vll                                  vector <long long>

#define vch                                  vector <char>

#define itr                                  ::iterator

#define msi                                  map<string,int>

#define psi                                  pair <string,int>

#define vii                                  vector <pair<int,int> >

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

#define INF                                  10000000000000000LL

#define pi                                   3.1415926535897932384626434

#define sii                                  set <int>

#define max3(a,b,c)                          max(a,max(b,c))

#define min3(a,b,c)                          min(a,min(b,c))

#define mid3(a,b,c)                          min(max(a,b),max(b,c),max(a,b))

#define max4(a,b,c,d)                        max(max(a,b),max(c,d))

#define min4(a,b,c,d)                        min(min(a,b),min(c,d))

#define endl                                 '\n'

#define endll                                cout<<"\n";

#define spc                                  ' '

#define ld                                   long double



using namespace std;







int main()

{

    flash

    string s,st;

    ll n,t,T,i,j,J,I,k,m;

    char ch;

    cin>>n;

    m=0;

    fr(i,1,n+1)

    {

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

        m+=i;

    }

    cout<<m;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 1.9146178349916054x):
#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)

		{

			continue;

		}

		else

		{

			sum+=i;

		}

	}

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

	return 0;

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

#include<cmath>

#include<iostream>

#include<algorithm>

#include<cstring>

#include<cstdlib>

#include<queue>

#include<map>

#include<stack>

#include<set>

#include<vector>

#include<functional>

using namespace std;

typedef long long LL;

inline LL read()

{

	LL kk=0,f=1;

	char cc=getchar();

	while(cc<'0'||cc>'9'){if(cc=='-')f=-1;cc=getchar();}

	while(cc>='0'&&cc<='9'){kk=(kk<<1)+(kk<<3)+cc-'0';cc=getchar();}

	return kk*f;

}

bool vis[2000222];int n;

int main()

{

	n=read();

	for(int i=1;i<=n/5+10;++i)vis[i*5]=1;

	for(int i=1;i<=n/3+10;++i)vis[i*3]=1;

	LL asd=0;

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

	{

		if(!vis[i])asd+=i;

	}

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

}

// Faster C++ solution for the same problem (measured speedup: 2.4004576259920336x):
#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)

		{

			continue;

		}

		else

		{

			sum+=i;

		}

	}

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

	return 0;

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

using namespace std;

#define elif else if

typedef long long ll;

typedef unsigned long long ull;

#define DEBUG(x) cout<<(x)<<endl



int main()

{

    ll n;

    scanf("%lld", &n);

    ll ans = 0;

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

    {

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

        {

            // puts("FizzBuzz");

            ;

        }

        elif(i%3==0)

        {

            // puts("Fizz");

            ;

        }

        elif(i%5==0)

        {

            // puts("Buzz");

            ;

        }

        else

        {

            ans += i;

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

        }

    }

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

    

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.970163252234371x):
#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)

		{

			continue;

		}

		else

		{

			sum+=i;

		}

	}

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

	return 0;

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

using namespace std;

long long n;

long long ans;

int main(){

	cin>>n;

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

		if (i%3==0){

			continue;

		}

		if (i%5==0){

			continue;

		}

		ans+=i;

	}

	cout<<ans<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 2.563839624737511x):
#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)

		{

			continue;

		}

		else

		{

			sum+=i;

		}

	}

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

	return 0;

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

using namespace std;



int main()

{

     int n,i;

     long long  sum=0;



     cin>>n;



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

     {

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

               sum=sum;

          else if(i%3==0)

               sum==sum;

          else if(i%5==0)

               sum==sum;

               else

                    sum+=i;



     }

     cout<<sum<<endl;

}


// Faster C++ solution for the same problem (measured speedup: 1.900501004624083x):
#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)

		{

			continue;

		}

		else

		{

			sum+=i;

		}

	}

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

	return 0;

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

#define mp make_pair

#define ff first

#define ss second

#define pb push_back

#define w(x) scanf("%d",&x);while(x--)

#define rep(i,a,b) for(i=a;i<=b;i++)

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

#define pi 2*acos(0.0)

using namespace std;

typedef long long ll;

typedef pair<ll,ll> pll;

typedef vector<int> vi;



long long int mod=1e9+9;

const int N=100000;

int t,i,j,cs=0,n,a,b;

string s;



int main()

{

    long long n;

    cin>>n;

    long long ans=n*(n+1)/2 ;

     long long a=n;

     n/=3;

     ans-=3*n*(n+1)/2;

     n=a/5;

     ans-=5*n*(n+1)/2;

     n=a/15;

     ans+=15*n*(n+1)/2;

    cout<<ans<<endl;

}






// Faster C++ solution for the same problem (measured speedup: 1.1122616120330893x):
#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)

		{

			continue;

		}

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

int main()

{



   long long int i,N,sum,sum1=0,sum2=0,sum3=0,sum4=0;

   scanf("%lld",&N);

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

   {   sum4=sum4+i;

       if(i%3==0)

       sum1=sum1+i;

       else if(i%5==0)

       sum2=sum2+i;

       else if(i%15==0)

        sum3=sum3+i;



       sum=sum1+sum2+sum3;

   }

   printf("%lld",sum4-sum);



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

	long long int tes = 0;

	scanf("%lld", &n);

	

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

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

			tes = tes + i;

			;

		}

	}

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

	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;

	long long int tes = 0;

	scanf("%lld", &n);

	

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

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

			tes = tes + i;

			;

		}

	}

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

	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;

	long long int tes = 0;

	scanf("%lld", &n);

	

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

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

			tes = tes + i;

			;

		}

	}

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

	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;

	long long int tes = 0;

	scanf("%lld", &n);

	

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

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

			tes = tes + i;

			;

		}

	}

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

	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;

	long long int tes = 0;

	scanf("%lld", &n);

	

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

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

			tes = tes + i;

			;

		}

	}

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

	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;

	long long int tes = 0;

	scanf("%lld", &n);

	

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

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

			tes = tes + i;

			;

		}

	}

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

	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;

	long long int tes = 0;

	scanf("%lld", &n);

	

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

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

			tes = tes + i;

			;

		}

	}

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

	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;

	long long int tes = 0;

	scanf("%lld", &n);

	

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

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

			tes = tes + i;

			;

		}

	}

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

	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;

	long long int tes = 0;

	scanf("%lld", &n);

	

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

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

			tes = tes + i;

			;

		}

	}

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

	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;

	long long int tes = 0;

	scanf("%lld", &n);

	

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

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

			tes = tes + i;

			;

		}

	}

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

	return 0;

}