import sys input = sys.stdin.readline from collections import Counter N=int(input()) X=[i for i in range(N+1)] for i in range(1,N+1): if X[i]!=i: continue for j in range(1,N+1): if i*j*j<=N: X[i*j*j]=i else: break C=Counter(X) ANS=0 for c in C: ANS+=C[c]*C[c] print(ANS-1)