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

using namespace std;

int main(){

	long long n,sum=0;

	cin>>n;

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

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

			continue;

		}

		else{

			sum+=i;

		}

	}

	cout<<sum;

}

// Faster C++ solution for the same problem (measured speedup: 1.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 || 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;

    long long int sum=0;

    scanf("%d",&N);

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

    {

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

        {

            sum = sum + i;

        }

    }

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

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.888444379098307x):
#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 || 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 unsigned i,N,sum=0;

    cin>>N;



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

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

            sum=sum+i;

        }

    }

    cout<<sum<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.9003503818068903x):
#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 || i % 5 == 0){



    }else {

        sum += i;

    }

}

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

    return 0;

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

#include <cstring>



#define pi 2*acos(0.00)

#define ll long long

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

#define nl '\n'

#define null '\0'



using namespace std;



int main()

{

    fastio;



    ll n,i,sum=0;

    cin>>n;

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

    {

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

        sum+=i;

    }    

    cout<<sum;

}

// Faster C++ solution for the same problem (measured speedup: 1.915058499550477x):
#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 || i % 5 == 0){



    }else {

        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.249359655342118x):
#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 || i % 5 == 0){



    }else {

        sum += i;

    }

}

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

    return 0;

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

#include<cstdio>

#include<iomanip>

#include<algorithm>

#include<cstring>

#include<cmath>

#include<vector>

#include<map>

using namespace std;

string s[10005];

int main() 

{

	int n;

    cin>>n;

    long long ans=0;

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

    {

        if (i%3==0)

        continue;

        else if (i%5==0)

        continue;

        else

        ans+=i;

    }

    cout<<ans<<endl;

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 2.264741086115905x):
#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 || i % 5 == 0){



    }else {

        sum += i;

    }

}

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

    return 0;

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



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

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

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

#define F first

#define S second

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



using namespace std;

typedef long long ll;

typedef pair<int, int> pii;

const int INF = 0x3f3f3f3f;

mt19937 gen(random_device{}());

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



int main() {

    ios::sync_with_stdio(false);

    cin.tie(nullptr);

    int n;

    cin>>n;

    ll sum=0;

    for1(i,n){

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

    }

    cout<<sum;

    return 0;

}




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

    cin>>n;

    long long count=0;

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

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

            {//cout<<"FizzBuzz\n";

            count+=i;}

        else if(i%3 == 0)

            {//cout<<"Fizz\n";

            count+=i;}

        else if(i%5 == 0)

            {//cout<<"Buzz\n";

            count+=i;}

     }

     cout<<(n*(n+1))/2-count<<endl;

    return 0;

}  

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

inline ll calc(ll x) {

	return (x+1)*x/2; 

}

int main() {

	ll n,ans;

	cin>>n;

	ans=calc(n)-calc(n/3)*3-calc(n/5)*5+calc(n/15)*15;

	cout<<ans<<endl;

	return 0;

} 

// Faster C++ solution for the same problem (measured speedup: 1.1123187810094415x):
#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 || 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,sum=0;

	cin>>n;

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

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

			continue;

		}

		else{

			sum+=i;

		}

	}

	cout<<sum;

}

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



int main() {

	long long int n;

	scanf("%lld", &n);

	long long int total = 0;

	

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

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

			continue;

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

		continue;

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

		continue;

	} else { 

		total += i;

	}

}

	printf("%lld", total);

	return 0;

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

using namespace std;

int main()

{

    int N;

    long long int sum=0;

    scanf("%d",&N);

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

    {

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

        {

            sum = sum + i;

        }

    }

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

    return 0;

}


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



int main() {

	long long int n;

	scanf("%lld", &n);

	long long int total = 0;

	

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

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

			continue;

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

		continue;

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

		continue;

	} else { 

		total += i;

	}

}

	printf("%lld", total);

	return 0;

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

using namespace std;

int main()

{

    long long unsigned i,N,sum=0;

    cin>>N;



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

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

            sum=sum+i;

        }

    }

    cout<<sum<<endl;

    return 0;

}


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



int main() {

	long long int n;

	scanf("%lld", &n);

	long long int total = 0;

	

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

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

			continue;

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

		continue;

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

		continue;

	} else { 

		total += i;

	}

}

	printf("%lld", total);

	return 0;

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

#include <cstring>



#define pi 2*acos(0.00)

#define ll long long

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

#define nl '\n'

#define null '\0'



using namespace std;



int main()

{

    fastio;



    ll n,i,sum=0;

    cin>>n;

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

    {

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

        sum+=i;

    }    

    cout<<sum;

}

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



int main() {

	long long int n;

	scanf("%lld", &n);

	long long int total = 0;

	

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

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

			continue;

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

		continue;

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

		continue;

	} else { 

		total += i;

	}

}

	printf("%lld", total);

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



int main() {

	long long int n;

	scanf("%lld", &n);

	long long int total = 0;

	

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

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

			continue;

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

		continue;

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

		continue;

	} else { 

		total += i;

	}

}

	printf("%lld", 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: 2.2654497392094473x):
#include <stdio.h>



int main() {

	long long int n;

	scanf("%lld", &n);

	long long int total = 0;

	

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

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

			continue;

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

		continue;

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

		continue;

	} else { 

		total += i;

	}

}

	printf("%lld", total);

	return 0;

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



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

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

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

#define F first

#define S second

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



using namespace std;

typedef long long ll;

typedef pair<int, int> pii;

const int INF = 0x3f3f3f3f;

mt19937 gen(random_device{}());

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



int main() {

    ios::sync_with_stdio(false);

    cin.tie(nullptr);

    int n;

    cin>>n;

    ll sum=0;

    for1(i,n){

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

    }

    cout<<sum;

    return 0;

}




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



int main() {

	long long int n;

	scanf("%lld", &n);

	long long int total = 0;

	

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

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

			continue;

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

		continue;

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

		continue;

	} else { 

		total += i;

	}

}

	printf("%lld", total);

	return 0;

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

using namespace std;



int main()

{

    long long n;

    cin>>n;

    long long count=0;

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

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

            {//cout<<"FizzBuzz\n";

            count+=i;}

        else if(i%3 == 0)

            {//cout<<"Fizz\n";

            count+=i;}

        else if(i%5 == 0)

            {//cout<<"Buzz\n";

            count+=i;}

     }

     cout<<(n*(n+1))/2-count<<endl;

    return 0;

}  

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



int main() {

	long long int n;

	scanf("%lld", &n);

	long long int total = 0;

	

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

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

			continue;

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

		continue;

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

		continue;

	} else { 

		total += i;

	}

}

	printf("%lld", total);

	return 0;

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

using namespace std;

typedef long long ll;

inline ll calc(ll x) {

	return (x+1)*x/2; 

}

int main() {

	ll n,ans;

	cin>>n;

	ans=calc(n)-calc(n/3)*3-calc(n/5)*5+calc(n/15)*15;

	cout<<ans<<endl;

	return 0;

} 

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



int main() {

	long long int n;

	scanf("%lld", &n);

	long long int total = 0;

	

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

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

			continue;

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

		continue;

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

		continue;

	} else { 

		total += i;

	}

}

	printf("%lld", total);

	return 0;

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

using namespace std;

int main(){

	long long n,sum=0;

	cin>>n;

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

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

			continue;

		}

		else{

			sum+=i;

		}

	}

	cout<<sum;

}

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



int main () {

	int test;

	scanf("%d", &test);

	int fizzbuzz;

	long long int jumlah = 0;

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

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

			fizzbuzz+=i;

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

			fizzbuzz+=i; 

		}else{

			jumlah+=i;

		}

	}

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

	return 0;

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

using namespace std;

int main()

{

    int N;

    long long int sum=0;

    scanf("%d",&N);

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

    {

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

        {

            sum = sum + i;

        }

    }

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

    return 0;

}


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



int main () {

	int test;

	scanf("%d", &test);

	int fizzbuzz;

	long long int jumlah = 0;

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

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

			fizzbuzz+=i;

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

			fizzbuzz+=i; 

		}else{

			jumlah+=i;

		}

	}

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

	return 0;

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

using namespace std;

int main()

{

    long long unsigned i,N,sum=0;

    cin>>N;



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

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

            sum=sum+i;

        }

    }

    cout<<sum<<endl;

    return 0;

}


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



int main () {

	int test;

	scanf("%d", &test);

	int fizzbuzz;

	long long int jumlah = 0;

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

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

			fizzbuzz+=i;

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

			fizzbuzz+=i; 

		}else{

			jumlah+=i;

		}

	}

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

	return 0;

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

#include <cstring>



#define pi 2*acos(0.00)

#define ll long long

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

#define nl '\n'

#define null '\0'



using namespace std;



int main()

{

    fastio;



    ll n,i,sum=0;

    cin>>n;

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

    {

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

        sum+=i;

    }    

    cout<<sum;

}

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



int main () {

	int test;

	scanf("%d", &test);

	int fizzbuzz;

	long long int jumlah = 0;

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

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

			fizzbuzz+=i;

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

			fizzbuzz+=i; 

		}else{

			jumlah+=i;

		}

	}

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

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



int main () {

	int test;

	scanf("%d", &test);

	int fizzbuzz;

	long long int jumlah = 0;

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

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

			fizzbuzz+=i;

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

			fizzbuzz+=i; 

		}else{

			jumlah+=i;

		}

	}

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

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



int main () {

	int test;

	scanf("%d", &test);

	int fizzbuzz;

	long long int jumlah = 0;

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

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

			fizzbuzz+=i;

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

			fizzbuzz+=i; 

		}else{

			jumlah+=i;

		}

	}

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

	return 0;

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



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

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

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

#define F first

#define S second

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



using namespace std;

typedef long long ll;

typedef pair<int, int> pii;

const int INF = 0x3f3f3f3f;

mt19937 gen(random_device{}());

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



int main() {

    ios::sync_with_stdio(false);

    cin.tie(nullptr);

    int n;

    cin>>n;

    ll sum=0;

    for1(i,n){

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

    }

    cout<<sum;

    return 0;

}




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



int main () {

	int test;

	scanf("%d", &test);

	int fizzbuzz;

	long long int jumlah = 0;

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

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

			fizzbuzz+=i;

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

			fizzbuzz+=i; 

		}else{

			jumlah+=i;

		}

	}

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

	return 0;

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

using namespace std;



int main()

{

    long long n;

    cin>>n;

    long long count=0;

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

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

            {//cout<<"FizzBuzz\n";

            count+=i;}

        else if(i%3 == 0)

            {//cout<<"Fizz\n";

            count+=i;}

        else if(i%5 == 0)

            {//cout<<"Buzz\n";

            count+=i;}

     }

     cout<<(n*(n+1))/2-count<<endl;

    return 0;

}  

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



int main () {

	int test;

	scanf("%d", &test);

	int fizzbuzz;

	long long int jumlah = 0;

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

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

			fizzbuzz+=i;

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

			fizzbuzz+=i; 

		}else{

			jumlah+=i;

		}

	}

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

	return 0;

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

using namespace std;

typedef long long ll;

inline ll calc(ll x) {

	return (x+1)*x/2; 

}

int main() {

	ll n,ans;

	cin>>n;

	ans=calc(n)-calc(n/3)*3-calc(n/5)*5+calc(n/15)*15;

	cout<<ans<<endl;

	return 0;

} 

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



int main () {

	int test;

	scanf("%d", &test);

	int fizzbuzz;

	long long int jumlah = 0;

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

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

			fizzbuzz+=i;

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

			fizzbuzz+=i; 

		}else{

			jumlah+=i;

		}

	}

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

	return 0;

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

using namespace std;

int main(){

	long long n,sum=0;

	cin>>n;

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

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

			continue;

		}

		else{

			sum+=i;

		}

	}

	cout<<sum;

}

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



int main(){

	long long int n;

	scanf("%lld", &n);

	

	long long sum = 0;

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

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

			continue;

		}

		if(i % 3 == 0){

			continue;

		}

		else if(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;

    long long int sum=0;

    scanf("%d",&N);

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

    {

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

        {

            sum = sum + i;

        }

    }

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

    return 0;

}


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



int main(){

	long long int n;

	scanf("%lld", &n);

	

	long long sum = 0;

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

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

			continue;

		}

		if(i % 3 == 0){

			continue;

		}

		else if(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 unsigned i,N,sum=0;

    cin>>N;



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

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

            sum=sum+i;

        }

    }

    cout<<sum<<endl;

    return 0;

}


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



int main(){

	long long int n;

	scanf("%lld", &n);

	

	long long sum = 0;

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

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

			continue;

		}

		if(i % 3 == 0){

			continue;

		}

		else if(i % 5 == 0){

			continue;

		}

		else{

			sum += i;

		}

	}

	

	printf("%lld", sum);

	

	return 0;

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

#include <cstring>



#define pi 2*acos(0.00)

#define ll long long

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

#define nl '\n'

#define null '\0'



using namespace std;



int main()

{

    fastio;



    ll n,i,sum=0;

    cin>>n;

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

    {

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

        sum+=i;

    }    

    cout<<sum;

}

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



int main(){

	long long int n;

	scanf("%lld", &n);

	

	long long sum = 0;

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

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

			continue;

		}

		if(i % 3 == 0){

			continue;

		}

		else if(i % 5 == 0){

			continue;

		}

		else{

			sum += i;

		}

	}

	

	printf("%lld", sum);

	

	return 0;

}