from collections import * from itertools import * from functools import * from heapq import * import sys,math input = sys.stdin.readline N = int(input()) flg = [False]*(N+1) ans = 0 if N==1: print(0) exit() for i in range(2,N+1): if flg[i]: continue ans += i for j in range(i,N+1,i): flg[j] = True print(ans)