def pn(x): for i in range(2,int(x**0.5)+1): if x%i==0: return 0 return 1 n = int(input()) c = 0 for i in range(2,n+1): c+=i*pn(i) print(c)