def sieve_of_eratosthenes(n): sieve = [True for _ in range(n + 1)] sieve[0:1] = [False, False] for i in range(2, n + 1): if sieve[i]: for j in range(2 * i, n + 1, i): sieve[j] = False primes = [] for i in range(2, n + 1): if sieve[i]: primes.append(i) return primes def main(): n = int(input()) print(sum(sieve_of_eratosthenes(n))) if __name__ == "__main__": main()