import sys
import numpy as np

N=int(input())
count = 0
j_check = 0
k_check = 0

for i in range(1,N+1):
    i_ins=[]
    for x in range(1,i+1):
        if i//x != 0 and i%x == 0:
            i_ins.append(x)
            for j in range(1,N+1):
                i_j_ins=[]
                for y in i_ins:
                    if j//y != 0 and j%y == 0:
                        i_j_ins.append(y)
                    else:
                        count = count + N
                        break
        
                for k in range(N+1):
                    print(i,j,k,i_j_ins)
                    for z in i_j_ins:
                        if k//z != 0 and k%z == 0:
                            count = count + z
                        else:
                            count = count + 1
                            j_check = 1
                            break

print(count)
