import numpy as np def is_prime(num): for i in range(2, num): if num % i == 0: return False return True n = int(input()) ans = 0 for i in range(2, n+1): if is_prime(i): ans += i print(ans)