import copy N = int(input()) sosu = [2] nums = list(range(3,N+1,2)) while 1: tmp = copy.deepcopy(nums) if len(nums)==0: break sosu.append(nums[0]) div = nums[0] for i in range(len(nums)): try: if nums[i]%div==0: nums.pop(i) i-=1 except IndexError: break if tmp==nums: break if N==1: print(0) elif N==2: print(1) else: print(sum(sosu)+sum(nums))