def sqrt(n): if n == 0: return 0 x = 1 << (n.bit_length() + 1) // 2 y = (x + n // x) // 2 while y < x: x = y y = (x + n // x) // 2 return x N = int(input()) nn = sqrt(N) X = [-1] * (nn+1) k = 2 while k <= nn: X[k] = 1 for i in range(k*2, nn+1, k): X[i] = 0 while k <= nn and X[k] >= 0: k += 1 P = [i for i in range(nn + 1) if X[i] == 1] Y = [1] * (N + 1) Y[0] = 0 for p in P: q = p ** 2 for i in range(1, N // q + 1, q)[::-1]: Y[i] += Y[i*q] Y[i*q] = 0 # print("Y =", Y) ans = 0 for a in Y: ans += a ** 2 print(ans)