#include <stdio.h>


int main(){
	unsigned long int n;
	unsigned long int sum=0;
	unsigned long int sum3=0;
	unsigned long int sum5=0;
	unsigned long int sum15=0;
	scanf("%ld",&n);
	
	sum = n*(n+1)/2;
	sum3 = n*(n+3)/6;
	sum5 = n*(n+5)/10;
	sum15 = n*(n+15)/30;
	
	printf("%ld\n",sum+sum15-sum3-sum5);
	
	
	return 0;
}