include<stdio.h>

main()
{int n,m,sum=0,tag;
scanf("%d",&n);
for(m=1;m<=n;m++)
{if(m%7==0)
{sum+=m;}}
printf("%d",sum);}