#include <stdio.h>
int main()
{
int n;
int m;
scanf("%d %d",&n,&m);
int x;
int cnt = 0;
int sum = 0;
for( x=2; cnt<=200; x++ )
{
int i;
int isPrime = 1;
for( i=2; i<x; i++ )
{
if( x % i == 0 )
{
isPrime = 0;
break;
}
}
if( isPrime == 1 )
{
cnt++;
if( cnt >= n && cnt <= m)
{
sum += x;
}
}
}
printf("%d",sum);
return 0;
}