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

#include <unordered_map> 

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

#define int long long

#define sp " "

#define fi freopen("bruh.txt","r",stdin);

#define fo freopen("input.txt", "w", stdout);

#define pb push_back

#define ff first

#define ss second

#define all(x) x.begin(),c.end();

#define allr(x) x.rbegin(), x.rend()

#define pii pair< int , int >

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

#define rev(i,n,a)for(int i=n;i>=a;i--)

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

long long inf=2e18;

long long minf=-inf;

using namespace std;



signed main(){

int n , m=0;

cin>>n;

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

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

    m+=i;

}

cout<<m<<endl;

}




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



#define ll long long



int main(){

	int n;

	scanf("%d", &n);

	ll sum = 0;

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

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

			continue;

		}

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

    cin>>n;

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

    {

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

            sum=sum+i;

    }

    cout<<sum;

}






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



#define ll long long



int main(){

	int n;

	scanf("%d", &n);

	ll sum = 0;

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

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

			continue;

		}

		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;

main()

{

    long long int x,c=0,i;

    cin>>i;

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

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



        else c+=x;

    }

    cout<<c;

}


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



#define ll long long



int main(){

	int n;

	scanf("%d", &n);

	ll sum = 0;

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

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

			continue;

		}

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

{

    int n,i;

    long long int sum=0;

    cin >> n;

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

    {

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

        {

            sum+=i;

        }



    }

    cout << sum;

    return 0;

}


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



#define ll long long



int main(){

	int n;

	scanf("%d", &n);

	ll sum = 0;

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

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

			continue;

		}

		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;

int main()

{

    int n;

    cin>>n;

    ll ans=0;

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



#define ll long long



int main(){

	int n;

	scanf("%d", &n);

	ll sum = 0;

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

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

			continue;

		}

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

long long sum=0;



int main()

{

	scanf("%d",&n);



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

	{

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

			

	}

	

	printf("%lld",sum);



	return 0;

}

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



#define ll long long



int main(){

	int n;

	scanf("%d", &n);

	ll sum = 0;

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

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

			continue;

		}

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

			continue;

		}

		else{

			sum += i;

		}

	}

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

	return 0;

}
// Slower C++ solution:
#pragma warning(disable:4996)

#include<iostream>

#include<stdio.h>

#include<sstream>

#include<cmath>

#include<stack>

#include<vector>

#include<string>

#include<algorithm>

#include<queue>

#include<map>

#include<set>

#include<limits.h>

using namespace std;

using ll = long long int;

inline ll get(ll i) {

	return (i + 1) * i / 2;

}

int main() {

	ll N;

	cin >> N;

	ll NDT = get(N / 3) * 3, NDF = get(N / 5) * 5, NDFIT = get(N / 15) * 15,

		FN = get(N);

	cout << FN - NDT - NDF + NDFIT;

	return 0;

}

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



#define ll long long



int main(){

	int n;

	scanf("%d", &n);

	ll sum = 0;

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

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

			continue;

		}

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

			continue;

		}

		else{

			sum += i;

		}

	}

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

	return 0;

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



int main(){



    long long int brpKali;

    int count=0;

    long long int hasil=0;

    int i=1;

    int j=0;

    long long int arrTampungan[1000000];

    scanf("%lld", &brpKali);

    while(i<=brpKali){

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

            //printf("Fizz");

        }

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

            //printf("Buzz");

        }

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

            //printf("FizzBuzz");

        }

        else{

           // printf("%d", i);

            arrTampungan[j]=i;

           // printf("\n ini array tampungan ke-%d :%d\n",j , arrTampungan[j]);

            count++;

            j++;

        }

        i++;



    }

 for(int k=0;k<count;k++){

    hasil+=arrTampungan[k];

 }

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

 

 

    return 0;

}

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



#define ll long long



int main(){

	int n;

	scanf("%d", &n);

	ll sum = 0;

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

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

			continue;

		}

		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;



#define ll long long

#define ull unsigned long long



#define min(a, b) ((a) > (b) ? (b) : (a))

#define max(a, b) ((a) > (b) ? (a) : (b))



bool isPalindrome(string s) {

    string t(s.rbegin(), s.rend());

    return s == t;

}



int main(void) {

    ll N;

    ll count = 0;

    cin >> N;

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

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

    }

    cout << count << endl;

    return 0;

}


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



long total = 0;



void FizzBuzz(const int m) {

    if(m % 3 != 0) {

        if(m % 5 != 0) total += m;

    }

}



int main(void) {

    int i, m;



    scanf("%d", &m);

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



    printf("%ld\n", total);



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

}
// 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.1917076172722285x):
#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;

}
// 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.0360539845066965x):
#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;

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

int main()

{

    long long int i,a,x=0;

    scanf("%lld",&a);

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

    {

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

          ;

        else

          x=x+i;

    }

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

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

int main()

{

    long long int i,a,x=0;

    scanf("%lld",&a);

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

    {

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

          ;

        else

          x=x+i;

    }

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

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

int main()

{

    long long int i,a,x=0;

    scanf("%lld",&a);

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

    {

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

          ;

        else

          x=x+i;

    }

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

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

int main()

{

    long long int i,a,x=0;

    scanf("%lld",&a);

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

    {

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

          ;

        else

          x=x+i;

    }

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

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

int main()

{

    long long int i,a,x=0;

    scanf("%lld",&a);

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

    {

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

          ;

        else

          x=x+i;

    }

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

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

int main()

{

    long long int i,a,x=0;

    scanf("%lld",&a);

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

    {

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

          ;

        else

          x=x+i;

    }

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

    return 0;

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



#define forn(i, n) for (int i = 0; i < int(n); ++i)

#define for1(i, n) for (int i = 1; i <= int(n); ++i)

#define ms(a, x) memset(a, x, sizeof(a))

#define F first

#define S second

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



using namespace std;

typedef long long ll;

typedef pair<int, int> pii;

const int INF = 0x3f3f3f3f;

mt19937 gen(random_device{}());

template<typename... Args> void write(Args... args) { ((cout << args << " "), ...); cout<<endl;}



int main() {

    ios::sync_with_stdio(false);

    cin.tie(nullptr);

    int n;

    cin>>n;

    ll sum=0;

    for1(i,n){

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

    }

    cout<<sum;

    return 0;

}




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

int main()

{

    long long int i,a,x=0;

    scanf("%lld",&a);

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

    {

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

          ;

        else

          x=x+i;

    }

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

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

int main()

{

    long long int i,a,x=0;

    scanf("%lld",&a);

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

    {

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

          ;

        else

          x=x+i;

    }

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

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

int main()

{

    long long int i,a,x=0;

    scanf("%lld",&a);

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

    {

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

          ;

        else

          x=x+i;

    }

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

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



int main(){

    long long int n, sum=0;

    

    scanf("%lld", &n);

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

        if (i % 5 != 0){

            if (i % 3 != 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: 0.9111338365057353x):
#include <stdio.h>



int main(){

    long long int n, sum=0;

    

    scanf("%lld", &n);

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

        if (i % 5 != 0){

            if (i % 3 != 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: 0.9168782269920989x):
#include <stdio.h>



int main(){

    long long int n, sum=0;

    

    scanf("%lld", &n);

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

        if (i % 5 != 0){

            if (i % 3 != 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: 0.923974577774689x):
#include <stdio.h>



int main(){

    long long int n, sum=0;

    

    scanf("%lld", &n);

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

        if (i % 5 != 0){

            if (i % 3 != 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.244760624443032x):
#include <stdio.h>



int main(){

    long long int n, sum=0;

    

    scanf("%lld", &n);

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

        if (i % 5 != 0){

            if (i % 3 != 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: 1.092688912272979x):
#include <stdio.h>



int main(){

    long long int n, sum=0;

    

    scanf("%lld", &n);

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

        if (i % 5 != 0){

            if (i % 3 != 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: 0.9919537124649833x):
#include <stdio.h>



int main(){

    long long int n, sum=0;

    

    scanf("%lld", &n);

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

        if (i % 5 != 0){

            if (i % 3 != 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: 0.9169102357288784x):
#include <stdio.h>



int main(){

    long long int n, sum=0;

    

    scanf("%lld", &n);

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

        if (i % 5 != 0){

            if (i % 3 != 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: 0.5366699117939745x):
#include <stdio.h>



int main(){

    long long int n, sum=0;

    

    scanf("%lld", &n);

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

        if (i % 5 != 0){

            if (i % 3 != 0){

                sum += i;

            }

        }

    }

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



return 0;

}