from collections import deque def primes(n): p = [] flgs = [False]*(n+1) for i in range(2, n+1): if not flgs[i]: p.append(i) for j in range(i*2, n+1, i): flgs[j] = True return p N = int(input()) answer = 0 ps = primes(N) queue = deque([(p, i, 0) for i, p in enumerate(ps)]) while queue: now, end, count = queue.popleft() cnt = N//now if count%2 == 0: answer += cnt*(cnt-1) // 2 else: answer -= cnt*(cnt-1) // 2 for j, p in enumerate(ps[end+1:], start=end+1): if now*p > N: break queue.append((now*p, j, count+1)) for i in range(2, N+1): if N//i == 1: break answer -= (N//i)-1 print(answer)