l, r = map(int, input().split()) s = 0 for i in range(l, r + 1): f = 0 for j in range(2,i): if i % j == 0: f = f + 1 if f == 0: s = s + i print(s)