stablegradients/pie-gem5-pairs huggingface dataset:
// 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.9321579926117902x):
#include <stdio.h>



int main (){

	int angka;

	scanf("%d", &angka);

	

	long long int sum =0;

	

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

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

			continue;

		}

		else if (i % 3 ==0){

			continue;

		}

		else if (i % 5 == 0){

			continue;

		}

		else {

			sum += i;

		}

	}

	

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



int main (){

	int angka;

	scanf("%d", &angka);

	

	long long int sum =0;

	

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

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

			continue;

		}

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

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



int main (){

	int angka;

	scanf("%d", &angka);

	

	long long int sum =0;

	

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

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

			continue;

		}

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



int main (){

	int angka;

	scanf("%d", &angka);

	

	long long int sum =0;

	

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

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

			continue;

		}

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



int main(){

	long long int n;

	scanf("%lld", &n);

	

	

	long long int total=0;

	

	if(n>=1){

		total=total+1;

	}

	if(n>=2){

		total=total+2;

	}

	if (n>3){

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

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

				continue;

			}

			total = total + i;

		}

	}

	printf("%lld", total);

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



int main(){

	long long int n;

	scanf("%lld", &n);

	

	

	long long int total=0;

	

	if(n>=1){

		total=total+1;

	}

	if(n>=2){

		total=total+2;

	}

	if (n>3){

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

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

				continue;

			}

			total = total + i;

		}

	}

	printf("%lld", total);

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



int main(){

	long long int n;

	scanf("%lld", &n);

	

	

	long long int total=0;

	

	if(n>=1){

		total=total+1;

	}

	if(n>=2){

		total=total+2;

	}

	if (n>3){

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

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

				continue;

			}

			total = total + i;

		}

	}

	printf("%lld", total);

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



int main(){

	long long int n;

	scanf("%lld", &n);

	

	

	long long int total=0;

	

	if(n>=1){

		total=total+1;

	}

	if(n>=2){

		total=total+2;

	}

	if (n>3){

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

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

				continue;

			}

			total = total + i;

		}

	}

	printf("%lld", total);

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



int main(){

	long long int n;

	scanf("%lld", &n);

	

	

	long long int total=0;

	

	if(n>=1){

		total=total+1;

	}

	if(n>=2){

		total=total+2;

	}

	if (n>3){

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

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

				continue;

			}

			total = total + i;

		}

	}

	printf("%lld", total);

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



int main(){

	long long int n;

	scanf("%lld", &n);

	

	

	long long int total=0;

	

	if(n>=1){

		total=total+1;

	}

	if(n>=2){

		total=total+2;

	}

	if (n>3){

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

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

				continue;

			}

			total = total + i;

		}

	}

	printf("%lld", total);

	return 0;

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



int main() {

    long long int n, s = 0;

    scanf("%lld", &n);

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

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

            s = s;

        } else {

            s += i;

        }

    }

    printf("%lld", s);

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



int main() {

    long long int n, s = 0;

    scanf("%lld", &n);

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

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

            s = s;

        } else {

            s += i;

        }

    }

    printf("%lld", s);

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



int main() {

    long long int n, s = 0;

    scanf("%lld", &n);

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

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

            s = s;

        } else {

            s += i;

        }

    }

    printf("%lld", s);

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



int main() {

    long long int n, s = 0;

    scanf("%lld", &n);

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

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

            s = s;

        } else {

            s += i;

        }

    }

    printf("%lld", s);

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



int main() {

    long long int n, s = 0;

    scanf("%lld", &n);

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

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

            s = s;

        } else {

            s += i;

        }

    }

    printf("%lld", s);

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



int main() {

    long long int n, s = 0;

    scanf("%lld", &n);

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

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

            s = s;

        } else {

            s += i;

        }

    }

    printf("%lld", s);

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



int main() {

    long long int n, s = 0;

    scanf("%lld", &n);

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

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

            s = s;

        } else {

            s += i;

        }

    }

    printf("%lld", s);

}
// 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.7550623331020623x):
#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) {

			continue;

		}

		else if (i % 3 == 0) {

			continue;

		}

		else if (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.7530420793897157x):
#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) {

			continue;

		}

		else if (i % 3 == 0) {

			continue;

		}

		else if (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.7838007749984914x):
#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) {

			continue;

		}

		else if (i % 3 == 0) {

			continue;

		}

		else if (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.7532570381096504x):
#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) {

			continue;

		}

		else if (i % 3 == 0) {

			continue;

		}

		else if (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.7532570381096504x):
#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) {

			continue;

		}

		else if (i % 3 == 0) {

			continue;

		}

		else if (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.0386306381704116x):
#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) {

			continue;

		}

		else if (i % 3 == 0) {

			continue;

		}

		else if (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.0252320904588852x):
#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) {

			continue;

		}

		else if (i % 3 == 0) {

			continue;

		}

		else if (i % 5 == 0) {

			continue;

		}

		else {

			sum += i;

		}

	}

	

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

	return 0;

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

int main () {

	long long int N;

	long long int sum=0;

	scanf("%lld",&N);

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

		if(i%15==0) {

		continue;

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

		continue;

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

		continue;

		}

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

int main () {

	long long int N;

	long long int sum=0;

	scanf("%lld",&N);

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

		if(i%15==0) {

		continue;

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

		continue;

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

		continue;

		}

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

int main () {

	long long int N;

	long long int sum=0;

	scanf("%lld",&N);

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

		if(i%15==0) {

		continue;

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

		continue;

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

		continue;

		}

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

int main () {

	long long int N;

	long long int sum=0;

	scanf("%lld",&N);

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

		if(i%15==0) {

		continue;

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

		continue;

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

		continue;

		}

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

int main () {

	long long int N;

	long long int sum=0;

	scanf("%lld",&N);

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

		if(i%15==0) {

		continue;

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

		continue;

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

		continue;

		}

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

int main () {

	long long int N;

	long long int sum=0;

	scanf("%lld",&N);

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

		if(i%15==0) {

		continue;

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

		continue;

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

		continue;

		}

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

int main () {

	long long int N;

	long long int sum=0;

	scanf("%lld",&N);

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

		if(i%15==0) {

		continue;

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

		continue;

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

		continue;

		}

	sum+=i;

}

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

	return 0;

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

#include <string.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){

			sum+=i;

		}

	}

	

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

	

return 0;

}