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

using namespace std;

int main()

{

	long long n,sum=0;

	cin>>n;

	long long a[n+1];

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

	{

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

		    a[i]=0;

		else

		    a[i]=i;

		sum+=a[i];

	}

	cout<<sum<<endl;

	return 0;

}

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

#include <string.h>



int main (){

	long long int input=0;

	long long int output=0;

	scanf("%lld", &input);

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

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

			output += i;

		}

	}

	printf("%lld",output);

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

#include<cmath>

#include<stack>

#include<vector>

#include<cstring>

#include<algorithm>

#include<set>

#include<queue>

#include <vector>

#include <list>

#include <map>

#include <set>

#include <deque>

#include <stack>

#include <bitset>

#include <algorithm>

#include <functional>

#include <numeric>

#include <utility>

#include <complex>

#include <sstream>

#include <iomanip>

#include <cstdio>

#include <cmath>

#include <cstdlib>

#include <cstring>

#include <ctime>

#include <cassert>

using namespace std;

typedef long long ll;

const ll inf =1e17;

#define scn(a) scanf("%d",&a)

#define scd(a) scanf("%lf",&a)

#define scl(a) scanf("%lld",&a)

#define ptf(a) printf("%d\n",&a)

#define mes(a,b) memset(a,b,sizeof(a))

#define fon(s,n) for(int i=s;i<=n;i++)

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

#define rerange(i,a,b) for(int i=a;i>=b;--i)

//#define N 100010

const int S=20;

int gcd(int a,int b) { return b>0 ? gcd(b,a%b):a;}

ll lcm(ll a,ll b){return a*b/gcd(a,b);}

ll q_pow(ll a,ll b,ll mod)

{

	ll ans=1,res=a;

	while(b){

		if(b&1) ans=ans*res%mod;

		res=res*res%mod;

		b>>=1;

	}

	return ans%mod;

}





int main(){

	int n;

	ll sum = 0;

	cin >> n;

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

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

		sum += i;

	}	

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

    return 0;

}




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

#include <string.h>



int main (){

	long long int input=0;

	long long int output=0;

	scanf("%lld", &input);

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

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

			output += i;

		}

	}

	printf("%lld",output);

}
// Slower C++ solution:
#define ll long long

#define pi acos(-1.0)

#define Go "\n"

#define bye return 0

#define Afor(i,b) for(int i=0;i<b;i++)

#include<bits/stdc++.h>

using namespace std;

int main()

{

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    ll N,i,s=0;

    cin>>N;

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

    {

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

        {

            s=s+i;

        }

    }

    cout<<s<<Go;

    bye;



}


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

#include <string.h>



int main (){

	long long int input=0;

	long long int output=0;

	scanf("%lld", &input);

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

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

			output += i;

		}

	}

	printf("%lld",output);

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

using namespace std;

int main()

{

    int t;

    scanf("%d",&t);

    long long sum=0;

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

    {

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

            continue;

        else sum+=i;

    }

    cout<<sum<<endl;

}


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

#include <string.h>



int main (){

	long long int input=0;

	long long int output=0;

	scanf("%lld", &input);

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

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

			output += i;

		}

	}

	printf("%lld",output);

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

#include<iostream>

using namespace std;

typedef long long ll;

ll sum (ll n) {

    return n*(n+1)/2;

}



int main() {

     ll n, res;

    scanf("%lld", &n);

    res=sum(n)-3*sum(n/3)-5*sum(n/5)+15*sum(n/15);

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

    return 0;

}


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

#include <string.h>



int main (){

	long long int input=0;

	long long int output=0;

	scanf("%lld", &input);

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

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

			output += i;

		}

	}

	printf("%lld",output);

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

using namespace std;

int main()

{

   long long int  n,i,s=0;

    cin>>n;

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

    {

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

        {

            s=s+i;

        }

    }cout<<s;

}


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



int main(){

	long long int N = 0, sum = 0;

	scanf("%lld", &N);

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

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

			sum += i;

		}

	}

	printf("%lld", sum);

	return 0;

}
// Slower C++ solution:
//#pragma GCC optimize("Ofast")

//#pragma GCC optimize ("unroll-loops")

//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")



#include <bits/stdc++.h>



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

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

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

#define nl                                  '\n'

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

#define debug(x)                            cerr << #x << " = " << x << nl



#define ll                                  long long

#define ull                                 unsigned long long

#define vi                                  vector<int>

#define pb                                  push_back

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

#define vpll                                vector<pair<ll, ll>>

#define mp                                  make_pair

#define ff                                  first

#define ss                                  second

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

#define rsort(v)                            sort(v.rbegin(), v.rend())



using namespace std;



const double pi = 2*acos(0.0);



int main(){

    //fastio; 

    //read;

    ull n, count = 0, sum = 0, i = 1;

    cin >> n;

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

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

    }

    cout << sum << nl;

}

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



int main(){

	long long int N = 0, sum = 0;

	scanf("%lld", &N);

	for(int i = 0; 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,i,sum = 0;

    cin >> n;



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

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

            continue;

        }

        sum += i;

    }

    cout << sum;

}


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



int main(){

	long long int N = 0, sum = 0;

	scanf("%lld", &N);

	for(int i = 0; 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)&&(i%5)&&(i%15)) sum+=i;

    }

    cout << sum << endl;

    return 0;

}


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



int main(){

	long long int N = 0, sum = 0;

	scanf("%lld", &N);

	for(int i = 0; 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,sum=0;

	cin>>n;

	long long a[n+1];

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

	{

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

		    a[i]=0;

		else

		    a[i]=i;

		sum+=a[i];

	}

	cout<<sum<<endl;

	return 0;

}

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



int main(){

	long long int N = 0, sum = 0;

	scanf("%lld", &N);

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

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

			sum += i;

		}

	}

	printf("%lld", sum);

	return 0;

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

#include<cmath>

#include<stack>

#include<vector>

#include<cstring>

#include<algorithm>

#include<set>

#include<queue>

#include <vector>

#include <list>

#include <map>

#include <set>

#include <deque>

#include <stack>

#include <bitset>

#include <algorithm>

#include <functional>

#include <numeric>

#include <utility>

#include <complex>

#include <sstream>

#include <iomanip>

#include <cstdio>

#include <cmath>

#include <cstdlib>

#include <cstring>

#include <ctime>

#include <cassert>

using namespace std;

typedef long long ll;

const ll inf =1e17;

#define scn(a) scanf("%d",&a)

#define scd(a) scanf("%lf",&a)

#define scl(a) scanf("%lld",&a)

#define ptf(a) printf("%d\n",&a)

#define mes(a,b) memset(a,b,sizeof(a))

#define fon(s,n) for(int i=s;i<=n;i++)

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

#define rerange(i,a,b) for(int i=a;i>=b;--i)

//#define N 100010

const int S=20;

int gcd(int a,int b) { return b>0 ? gcd(b,a%b):a;}

ll lcm(ll a,ll b){return a*b/gcd(a,b);}

ll q_pow(ll a,ll b,ll mod)

{

	ll ans=1,res=a;

	while(b){

		if(b&1) ans=ans*res%mod;

		res=res*res%mod;

		b>>=1;

	}

	return ans%mod;

}





int main(){

	int n;

	ll sum = 0;

	cin >> n;

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

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

		sum += i;

	}	

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

    return 0;

}




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



int main(){

	long long int N = 0, sum = 0;

	scanf("%lld", &N);

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

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

			sum += i;

		}

	}

	printf("%lld", sum);

	return 0;

}
// Slower C++ solution:
#define ll long long

#define pi acos(-1.0)

#define Go "\n"

#define bye return 0

#define Afor(i,b) for(int i=0;i<b;i++)

#include<bits/stdc++.h>

using namespace std;

int main()

{

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    ll N,i,s=0;

    cin>>N;

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

    {

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

        {

            s=s+i;

        }

    }

    cout<<s<<Go;

    bye;



}


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



int main(){

	long long int N = 0, sum = 0;

	scanf("%lld", &N);

	for(int i = 0; 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 t;

    scanf("%d",&t);

    long long sum=0;

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

    {

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

            continue;

        else sum+=i;

    }

    cout<<sum<<endl;

}


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



int main(){

	long long int N = 0, sum = 0;

	scanf("%lld", &N);

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

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

			sum += i;

		}

	}

	printf("%lld", sum);

	return 0;

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

#include<iostream>

using namespace std;

typedef long long ll;

ll sum (ll n) {

    return n*(n+1)/2;

}



int main() {

     ll n, res;

    scanf("%lld", &n);

    res=sum(n)-3*sum(n/3)-5*sum(n/5)+15*sum(n/15);

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

    return 0;

}


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



int main(){

	long long int N = 0, sum = 0;

	scanf("%lld", &N);

	for(int i = 0; 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 int  n,i,s=0;

    cin>>n;

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

    {

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

        {

            s=s+i;

        }

    }cout<<s;

}


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



#define ll long long



class FIO

{

public:

    template<typename T>FIO& operator >>(T& x){ _R(x);return *this; }

    template<typename T>FIO& operator <<(T x){ _W(x);return *this; }

private:

    char f,c,a[25],i;

    template<typename T>inline void _R(T& x)

    {

        for(f=0;(c=getchar())<48;c==45&&(f=1));

        for(x=c^48;(c=getchar())>47;x=(x<<3)+(x<<1)+(c^48));

        if(f)x=-x;

    }

    template<typename T>inline void _W(T x)

    {

        if(sizeof(x)==1){ putchar(x);return; }

        if(x<0)putchar(45),x=-x;

        if(x>99) {

            for(i=0;x;x/=10)a[i++]=x%10;

            while(i--)putchar(a[i]+48);

        } else if(x>9) putchar(x/10+48),putchar(x%10+48);

        else putchar(x+48);

    }

}io;



int main()

{

    ll n;

    io>>n;

    ll ans=0;

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

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

        ans+=i;

    }

    io<<ans;

    return 0;

}
// Slower C++ solution:
//#pragma GCC optimize("Ofast")

//#pragma GCC optimize ("unroll-loops")

//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")



#include <bits/stdc++.h>



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

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

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

#define nl                                  '\n'

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

#define debug(x)                            cerr << #x << " = " << x << nl



#define ll                                  long long

#define ull                                 unsigned long long

#define vi                                  vector<int>

#define pb                                  push_back

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

#define vpll                                vector<pair<ll, ll>>

#define mp                                  make_pair

#define ff                                  first

#define ss                                  second

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

#define rsort(v)                            sort(v.rbegin(), v.rend())



using namespace std;



const double pi = 2*acos(0.0);



int main(){

    //fastio; 

    //read;

    ull n, count = 0, sum = 0, i = 1;

    cin >> n;

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

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

    }

    cout << sum << nl;

}

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



#define ll long long



class FIO

{

public:

    template<typename T>FIO& operator >>(T& x){ _R(x);return *this; }

    template<typename T>FIO& operator <<(T x){ _W(x);return *this; }

private:

    char f,c,a[25],i;

    template<typename T>inline void _R(T& x)

    {

        for(f=0;(c=getchar())<48;c==45&&(f=1));

        for(x=c^48;(c=getchar())>47;x=(x<<3)+(x<<1)+(c^48));

        if(f)x=-x;

    }

    template<typename T>inline void _W(T x)

    {

        if(sizeof(x)==1){ putchar(x);return; }

        if(x<0)putchar(45),x=-x;

        if(x>99) {

            for(i=0;x;x/=10)a[i++]=x%10;

            while(i--)putchar(a[i]+48);

        } else if(x>9) putchar(x/10+48),putchar(x%10+48);

        else putchar(x+48);

    }

}io;



int main()

{

    ll n;

    io>>n;

    ll ans=0;

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

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

        ans+=i;

    }

    io<<ans;

    return 0;

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

using namespace std;



int main()

{

    long long n,i,sum = 0;

    cin >> n;



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

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

            continue;

        }

        sum += i;

    }

    cout << sum;

}


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



#define ll long long



class FIO

{

public:

    template<typename T>FIO& operator >>(T& x){ _R(x);return *this; }

    template<typename T>FIO& operator <<(T x){ _W(x);return *this; }

private:

    char f,c,a[25],i;

    template<typename T>inline void _R(T& x)

    {

        for(f=0;(c=getchar())<48;c==45&&(f=1));

        for(x=c^48;(c=getchar())>47;x=(x<<3)+(x<<1)+(c^48));

        if(f)x=-x;

    }

    template<typename T>inline void _W(T x)

    {

        if(sizeof(x)==1){ putchar(x);return; }

        if(x<0)putchar(45),x=-x;

        if(x>99) {

            for(i=0;x;x/=10)a[i++]=x%10;

            while(i--)putchar(a[i]+48);

        } else if(x>9) putchar(x/10+48),putchar(x%10+48);

        else putchar(x+48);

    }

}io;



int main()

{

    ll n;

    io>>n;

    ll ans=0;

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

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

        ans+=i;

    }

    io<<ans;

    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)&&(i%5)&&(i%15)) sum+=i;

    }

    cout << sum << endl;

    return 0;

}


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



#define ll long long



class FIO

{

public:

    template<typename T>FIO& operator >>(T& x){ _R(x);return *this; }

    template<typename T>FIO& operator <<(T x){ _W(x);return *this; }

private:

    char f,c,a[25],i;

    template<typename T>inline void _R(T& x)

    {

        for(f=0;(c=getchar())<48;c==45&&(f=1));

        for(x=c^48;(c=getchar())>47;x=(x<<3)+(x<<1)+(c^48));

        if(f)x=-x;

    }

    template<typename T>inline void _W(T x)

    {

        if(sizeof(x)==1){ putchar(x);return; }

        if(x<0)putchar(45),x=-x;

        if(x>99) {

            for(i=0;x;x/=10)a[i++]=x%10;

            while(i--)putchar(a[i]+48);

        } else if(x>9) putchar(x/10+48),putchar(x%10+48);

        else putchar(x+48);

    }

}io;



int main()

{

    ll n;

    io>>n;

    ll ans=0;

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

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

        ans+=i;

    }

    io<<ans;

    return 0;

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

using namespace std;

int main()

{

	long long n,sum=0;

	cin>>n;

	long long a[n+1];

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

	{

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

		    a[i]=0;

		else

		    a[i]=i;

		sum+=a[i];

	}

	cout<<sum<<endl;

	return 0;

}

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



#define ll long long



class FIO

{

public:

    template<typename T>FIO& operator >>(T& x){ _R(x);return *this; }

    template<typename T>FIO& operator <<(T x){ _W(x);return *this; }

private:

    char f,c,a[25],i;

    template<typename T>inline void _R(T& x)

    {

        for(f=0;(c=getchar())<48;c==45&&(f=1));

        for(x=c^48;(c=getchar())>47;x=(x<<3)+(x<<1)+(c^48));

        if(f)x=-x;

    }

    template<typename T>inline void _W(T x)

    {

        if(sizeof(x)==1){ putchar(x);return; }

        if(x<0)putchar(45),x=-x;

        if(x>99) {

            for(i=0;x;x/=10)a[i++]=x%10;

            while(i--)putchar(a[i]+48);

        } else if(x>9) putchar(x/10+48),putchar(x%10+48);

        else putchar(x+48);

    }

}io;



int main()

{

    ll n;

    io>>n;

    ll ans=0;

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

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

        ans+=i;

    }

    io<<ans;

    return 0;

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

#include<cmath>

#include<stack>

#include<vector>

#include<cstring>

#include<algorithm>

#include<set>

#include<queue>

#include <vector>

#include <list>

#include <map>

#include <set>

#include <deque>

#include <stack>

#include <bitset>

#include <algorithm>

#include <functional>

#include <numeric>

#include <utility>

#include <complex>

#include <sstream>

#include <iomanip>

#include <cstdio>

#include <cmath>

#include <cstdlib>

#include <cstring>

#include <ctime>

#include <cassert>

using namespace std;

typedef long long ll;

const ll inf =1e17;

#define scn(a) scanf("%d",&a)

#define scd(a) scanf("%lf",&a)

#define scl(a) scanf("%lld",&a)

#define ptf(a) printf("%d\n",&a)

#define mes(a,b) memset(a,b,sizeof(a))

#define fon(s,n) for(int i=s;i<=n;i++)

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

#define rerange(i,a,b) for(int i=a;i>=b;--i)

//#define N 100010

const int S=20;

int gcd(int a,int b) { return b>0 ? gcd(b,a%b):a;}

ll lcm(ll a,ll b){return a*b/gcd(a,b);}

ll q_pow(ll a,ll b,ll mod)

{

	ll ans=1,res=a;

	while(b){

		if(b&1) ans=ans*res%mod;

		res=res*res%mod;

		b>>=1;

	}

	return ans%mod;

}





int main(){

	int n;

	ll sum = 0;

	cin >> n;

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

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

		sum += i;

	}	

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

    return 0;

}




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



#define ll long long



class FIO

{

public:

    template<typename T>FIO& operator >>(T& x){ _R(x);return *this; }

    template<typename T>FIO& operator <<(T x){ _W(x);return *this; }

private:

    char f,c,a[25],i;

    template<typename T>inline void _R(T& x)

    {

        for(f=0;(c=getchar())<48;c==45&&(f=1));

        for(x=c^48;(c=getchar())>47;x=(x<<3)+(x<<1)+(c^48));

        if(f)x=-x;

    }

    template<typename T>inline void _W(T x)

    {

        if(sizeof(x)==1){ putchar(x);return; }

        if(x<0)putchar(45),x=-x;

        if(x>99) {

            for(i=0;x;x/=10)a[i++]=x%10;

            while(i--)putchar(a[i]+48);

        } else if(x>9) putchar(x/10+48),putchar(x%10+48);

        else putchar(x+48);

    }

}io;



int main()

{

    ll n;

    io>>n;

    ll ans=0;

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

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

        ans+=i;

    }

    io<<ans;

    return 0;

}
// Slower C++ solution:
#define ll long long

#define pi acos(-1.0)

#define Go "\n"

#define bye return 0

#define Afor(i,b) for(int i=0;i<b;i++)

#include<bits/stdc++.h>

using namespace std;

int main()

{

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    ll N,i,s=0;

    cin>>N;

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

    {

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

        {

            s=s+i;

        }

    }

    cout<<s<<Go;

    bye;



}


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



#define ll long long



class FIO

{

public:

    template<typename T>FIO& operator >>(T& x){ _R(x);return *this; }

    template<typename T>FIO& operator <<(T x){ _W(x);return *this; }

private:

    char f,c,a[25],i;

    template<typename T>inline void _R(T& x)

    {

        for(f=0;(c=getchar())<48;c==45&&(f=1));

        for(x=c^48;(c=getchar())>47;x=(x<<3)+(x<<1)+(c^48));

        if(f)x=-x;

    }

    template<typename T>inline void _W(T x)

    {

        if(sizeof(x)==1){ putchar(x);return; }

        if(x<0)putchar(45),x=-x;

        if(x>99) {

            for(i=0;x;x/=10)a[i++]=x%10;

            while(i--)putchar(a[i]+48);

        } else if(x>9) putchar(x/10+48),putchar(x%10+48);

        else putchar(x+48);

    }

}io;



int main()

{

    ll n;

    io>>n;

    ll ans=0;

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

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

        ans+=i;

    }

    io<<ans;

    return 0;

}