#include <stdio.h>
int eh_primo( unsigned int n )
{
unsigned int i = 0;
if( n <= 1 )
return 0;
for( i = 2; i * i <= n; i++ )
if( n % i == 0 )
return 0;
return 1;
}
int somar_primos( int inicio, int fim )
{
int i = 0;
int soma = 0;
for( i = inicio; i < fim; i++ )
if( eh_primo(i) )
soma += i;
return soma;
}
int main( void )
{
int numI, numF;
scanf("%d %d", &numI
, &numF
); printf( "%d\n", somar_primos
( numI
, numF
) ); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgZWhfcHJpbW8oIHVuc2lnbmVkIGludCBuICkKewoJdW5zaWduZWQgaW50IGkgPSAwOwoKICAgIGlmKCBuIDw9IDEgKQoJCXJldHVybiAwOwoKICAgIGZvciggaSA9IDI7IGkgKiBpIDw9IG47IGkrKyApCgkJaWYoIG4gJSBpID09IDAgKQoJCQlyZXR1cm4gMDsKCglyZXR1cm4gMTsKfQoKaW50IHNvbWFyX3ByaW1vcyggaW50IGluaWNpbywgaW50IGZpbSApCnsKCWludCBpID0gMDsKCWludCBzb21hID0gMDsKCglmb3IoIGkgPSBpbmljaW87IGkgPCBmaW07IGkrKyApCgkJaWYoIGVoX3ByaW1vKGkpICkKCQkJc29tYSArPSBpOwoKCXJldHVybiBzb21hOwp9CgppbnQgbWFpbiggdm9pZCApCnsKCWludCBudW1JLCBudW1GOwoJc2NhbmYoIiVkICVkIiwgJm51bUksICZudW1GKTsKCXByaW50ZiggIiVkXG4iLCBzb21hcl9wcmltb3MoIG51bUksIG51bUYgKSApOwoJcmV0dXJuIDA7Cn0K