n = int(input()) lists = list(range(2, n+1, 1)) for i in lists: lists_sub = list(range(i*2, n+1, i)) lists = list(set(lists) - set(lists_sub)) print(sum(lists))