#include<stdio.h>
#include<stdlib.h>
int IsPrime(int x)
{
int i,j,sum,sum1=0;
for(j=2;j<=x;j++)
{
sum = 0;
for(i = 2; i < j;i++)
{
if(j % i == 0)
{
sum +=1;
}
}
if(sum == 0)
sum1 += j;
}
return sum1;
}
int main()
{
int n,result;
scanf("%d",&n);
result = IsPrime(n);
printf("%d",result);
system("pause");
}