def eratosthenes(n): if n < 2: return [0] if n == 2: return [2] prime = [2] limit = int(n**0.5)+1 data = [i for i in range(3, n+1, 2)] while True: p = data[0] if limit <= p: return prime + data prime.append(p) data = [e for e in data if e%p!=0] def main(): n = int(input()) arr = eratosthenes(n) print(sum(arr)) main()