#include <stdio.h>
int eh_primo( int n )
{
int i = 0;
if( n <= 1 )
return 0;
if( (n % 2 == 0) && (n > 2) )
return 0;
for( i = 3; i < n / 2; i += 2 )
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+CgppbnQgZWhfcHJpbW8oIGludCBuICkKewoJaW50IGkgPSAwOwoKCWlmKCBuIDw9IDEgKQoJCXJldHVybiAwOwoKCWlmKCAobiAlIDIgPT0gMCkgJiYgKG4gPiAyKSApCgkJcmV0dXJuIDA7CgoJZm9yKCBpID0gMzsgaSA8IG4gLyAyOyBpICs9IDIgKQoJCWlmKCBuICUgaSA9PSAwICkKCQkJcmV0dXJuIDA7CgoJcmV0dXJuIDE7Cn0KCmludCBzb21hcl9wcmltb3MoIGludCBpbmljaW8sIGludCBmaW0gKQp7CglpbnQgaSA9IDA7CglpbnQgc29tYSA9IDA7CgoJZm9yKCBpID0gaW5pY2lvOyBpIDwgZmltOyBpKysgKQoJCWlmKCBlaF9wcmltbyhpKSApCgkJCXNvbWEgKz0gaTsKCglyZXR1cm4gc29tYTsKfQoKaW50IG1haW4oIHZvaWQgKQp7CglpbnQgbnVtSSwgbnVtRjsKCXNjYW5mKCIlZCAlZCIsICZudW1JLCAmbnVtRik7CglwcmludGYoICIlZFxuIiwgc29tYXJfcHJpbW9zKCBudW1JLCBudW1GICkgKTsKCXJldHVybiAwOwp9Cg==