#include<stdio.h>
int main(agrc *agrv)
{
int n,i;
int sum=0;
scanf("%d",&n);
for(i=1;i<=n;i++){
if(i%3==0&&i%7!=0){
sum+=i;
}
}
printf("%d\n",sum);
}
2021-08-09 11:10:07
int main(agrc *agrv)
{
int n,i;
int sum=0;
scanf("%d",&n);
for(i=1;i<=n;i++){
if(i%3==0&&i%7!=0){
sum+=i;
}
}
printf("%d\n",sum);
}