#include <stdio.h>
int main(){
int n, sum;
  scanf("%d",&n);
  
  for(int i = 0;i > n;i++{
       if( i % 3 == 0 || i % 5 == 0){
         sum = sum 
       }
     
       else {
           sum = sum + i;
       }
  }
      
         printf("%d\n",&sum);
 return 0;
}     
      