stablegradients/pie-gem5-pairs huggingface dataset:
// 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.257019158169307x):
#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<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.0918809392148217x):
#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>



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

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



int main()

{

	int a;

	long long total =0;

	int sum =0;

	int z =0;

	scanf("%d",&a);

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

	{

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

		{

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



int main()

{

	int a;

	long long total =0;

	int sum =0;

	int z =0;

	scanf("%d",&a);

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

	{

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

		{

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



int main()

{

	int a;

	long long total =0;

	int sum =0;

	int z =0;

	scanf("%d",&a);

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

	{

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

		{

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



int main()

{

	int a;

	long long total =0;

	int sum =0;

	int z =0;

	scanf("%d",&a);

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

	{

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

		{

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



int main()

{

	int a;

	long long total =0;

	int sum =0;

	int z =0;

	scanf("%d",&a);

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

	{

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

		{

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



int main()

{

	int a;

	long long total =0;

	int sum =0;

	int z =0;

	scanf("%d",&a);

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

	{

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

		{

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



int main()

{

	int a;

	long long total =0;

	int sum =0;

	int z =0;

	scanf("%d",&a);

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

	{

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

		{

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



int main()

{

	int a;

	long long total =0;

	int sum =0;

	int z =0;

	scanf("%d",&a);

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

	{

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

		{

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



int main()

{

	int a;

	long long total =0;

	int sum =0;

	int z =0;

	scanf("%d",&a);

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

	{

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

		{

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



int main() {



  int a,i;

  int flag=0;

  long sum=0;

    

  scanf("%d",&a);



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

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

        flag+=1;

    }

      

    if(i%3==0) {

        flag+=1;

    }

      

    if(i%5==0) {

        flag+=1;

    }

      

    if(flag==0) {

        sum+=i;

    }

      

    flag=0;

  }



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



int main() {



  int a,i;

  int flag=0;

  long sum=0;

    

  scanf("%d",&a);



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

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

        flag+=1;

    }

      

    if(i%3==0) {

        flag+=1;

    }

      

    if(i%5==0) {

        flag+=1;

    }

      

    if(flag==0) {

        sum+=i;

    }

      

    flag=0;

  }



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



int main() {



  int a,i;

  int flag=0;

  long sum=0;

    

  scanf("%d",&a);



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

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

        flag+=1;

    }

      

    if(i%3==0) {

        flag+=1;

    }

      

    if(i%5==0) {

        flag+=1;

    }

      

    if(flag==0) {

        sum+=i;

    }

      

    flag=0;

  }



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



int main() {



  int a,i;

  int flag=0;

  long sum=0;

    

  scanf("%d",&a);



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

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

        flag+=1;

    }

      

    if(i%3==0) {

        flag+=1;

    }

      

    if(i%5==0) {

        flag+=1;

    }

      

    if(flag==0) {

        sum+=i;

    }

      

    flag=0;

  }



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



int main() {



  int a,i;

  int flag=0;

  long sum=0;

    

  scanf("%d",&a);



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

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

        flag+=1;

    }

      

    if(i%3==0) {

        flag+=1;

    }

      

    if(i%5==0) {

        flag+=1;

    }

      

    if(flag==0) {

        sum+=i;

    }

      

    flag=0;

  }



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



int main() {



  int a,i;

  int flag=0;

  long sum=0;

    

  scanf("%d",&a);



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

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

        flag+=1;

    }

      

    if(i%3==0) {

        flag+=1;

    }

      

    if(i%5==0) {

        flag+=1;

    }

      

    if(flag==0) {

        sum+=i;

    }

      

    flag=0;

  }



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



int main() {



  int a,i;

  int flag=0;

  long sum=0;

    

  scanf("%d",&a);



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

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

        flag+=1;

    }

      

    if(i%3==0) {

        flag+=1;

    }

      

    if(i%5==0) {

        flag+=1;

    }

      

    if(flag==0) {

        sum+=i;

    }

      

    flag=0;

  }



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



int main() {



  int a,i;

  int flag=0;

  long sum=0;

    

  scanf("%d",&a);



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

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

        flag+=1;

    }

      

    if(i%3==0) {

        flag+=1;

    }

      

    if(i%5==0) {

        flag+=1;

    }

      

    if(flag==0) {

        sum+=i;

    }

      

    flag=0;

  }



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



int main() {



  int a,i;

  int flag=0;

  long sum=0;

    

  scanf("%d",&a);



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

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

        flag+=1;

    }

      

    if(i%3==0) {

        flag+=1;

    }

      

    if(i%5==0) {

        flag+=1;

    }

      

    if(flag==0) {

        sum+=i;

    }

      

    flag=0;

  }



  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==0 || i%5==0){

			continue;

		}

		else{

			sum+=i;

		}

	}

	cout<<sum;

}

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



int main(){

    long long int n;

    scanf("%lld", &n);

    

    long long int sum = 0;

    

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

        if(i%15 && i%3 && i%5){

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



int main(){

    long long int n;

    scanf("%lld", &n);

    

    long long int sum = 0;

    

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

        if(i%15 && i%3 && i%5){

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



int main(){

    long long int n;

    scanf("%lld", &n);

    

    long long int sum = 0;

    

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

        if(i%15 && i%3 && i%5){

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



int main(){

    long long int n;

    scanf("%lld", &n);

    

    long long int sum = 0;

    

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

        if(i%15 && i%3 && i%5){

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



int main(){

    long long int n;

    scanf("%lld", &n);

    

    long long int sum = 0;

    

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

        if(i%15 && i%3 && i%5){

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



int main(){

    long long int n;

    scanf("%lld", &n);

    

    long long int sum = 0;

    

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

        if(i%15 && i%3 && i%5){

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



int main(){

    long long int n;

    scanf("%lld", &n);

    

    long long int sum = 0;

    

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

        if(i%15 && i%3 && i%5){

            sum += i;

        }

    }

    

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



    return 0;

}