#include <stdio.h>
int sum(int n);
int main(){
int n,p;
printf("enter the num: \n"); scanf("%d",&n);
p=sum(n);
printf("%d",p);
return 0;
}
int sum(int n){
int i,res=0;
for(i=1;i<=n;i++){
if(i%3 !=0 && i%5 !=0){
res+=i;
}
}
return res;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CmludCBzdW0oaW50IG4pOwppbnQgbWFpbigpewogICAgaW50IG4scDsKICAgIHByaW50ZigiZW50ZXIgdGhlIG51bTogXG4iKTsgc2NhbmYoIiVkIiwmbik7CiAgICBwPXN1bShuKTsKICAgIHByaW50ZigiJWQiLHApOwogICAgcmV0dXJuIDA7Cn0KaW50IHN1bShpbnQgbil7CiAgICBpbnQgaSxyZXM9MDsKICAgIGZvcihpPTE7aTw9bjtpKyspewogICAgICAgIGlmKGklMyAhPTAgJiYgaSU1ICE9MCl7CiAgICAgICAgICAgCiAgICAgICAgcmVzKz1pOwogICAgICAgIH0KICAgIH0KICAgIHJldHVybiByZXM7Cn0K