from collections import Counter


def prime_factors(n):
    i = 2
    factors = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            factors.append(i)
    if n > 1:
        factors.append(n)
    return factors


def gcd_3(a, b, c, mem):
    a_p = prime_factors(a) if a not in mem.keys() else mem[a]
    b_p = prime_factors(b) if b not in mem.keys() else mem[b]
    c_p = prime_factors(c) if c not in mem.keys() else mem[c]

    if a not in mem.keys():
        mem[a] = a_p
    if b not in mem.keys():
        mem[b] = b_p
    if c not in mem.keys():
        mem[c] = c_p

    a_f = Counter(a_p)
    b_f = Counter(b_p)
    c_f = Counter(c_p)
    common_factors = [(k, min([a_f[k], b_f[k], c_f[k]])) for k in a_f.keys() if k in b_f.keys() and k in c_f.keys()]
    common_factors = [[k] * v for k, v in common_factors]
    common_factors = [k for sublist in common_factors for k in sublist]

    res = 1

    for n in common_factors:
        res *= n

    return res


def solve(k, mem, mem_1):
    res = 0
    for i in range(1, k + 1):
        for j in range(1, k + 1):
            for h in range(1, k + 1):
                key = tuple(sorted([i, j, h]))
                if key in mem_1:
                    res += mem_1[key]
                else:
                    curr = gcd_3(i, j, h, mem)
                    res += curr
                    mem[key] = curr
    return res


prerecorded = {
    1: 1,
    2: 9,
    3: 30,
    4: 76,
    5: 141,
    6: 267,
    7: 400,
    8: 624,
    9: 885,
    10: 1249,
    11: 1590,
    12: 2208,
    13: 2689,
    14: 3411,
    15: 4248,
    16: 5248,
    17: 6081,
    18: 7485,
    19: 8530,
    20: 10248,
    21: 11889,
    22: 13687,
    23: 15228,
    24: 17988,
    25: 20053,
    26: 22569,
    27: 25242,
    28: 28588,
    29: 31053,
    30: 35463,
    31: 38284,
    32: 42540,
    33: 46581,
    34: 50893,
    35: 55362,
    36: 61824,
    37: 65857,
    38: 71247,
    39: 76884,
    40: 84388,
    41: 89349,
    42: 97881,
    43: 103342,
    44: 111528,
    45: 120141,
    46: 128047,
    47: 134580,
    48: 146316,
    49: 154177,
    50: 164817,
    51: 174438,
    52: 185836,
    53: 194157,
    54: 207927,
    55: 218812,
    56: 233268,
    57: 245277,
    58: 257857,
    59: 268182,
    60: 288216,
    61: 299257,
    62: 313635,
    63: 330204,
    64: 347836,
    65: 362973,
    66: 383709,
    67: 397042,
    68: 416448,
    69: 434025,
    70: 456967,
    71: 471948,
    72: 499740,
    73: 515581,
    74: 536073,
    75: 559758,
    76: 583960,
    77: 604833,
    78: 633651,
    79: 652216,
    80: 683712,
    81: 709065,
    82: 734233,
    83: 754734,
    84: 793188,
    85: 818917,
    86: 846603,
    87: 874512,
    88: 909496,
    89: 933081,
    90: 977145,
    91: 1006126,
    92: 1041504,
    93: 1073385,
    94: 1106467,
    95: 1138536,
    96: 1187112,
    97: 1215145,
    98: 1255101,
    99: 1295142,
    100: 1342852,
    101: 1373253,
    102: 1422195,
    103: 1453816,
    104: 1502376,
    105: 1553361,
    106: 1595437,
    107: 1629570,
    108: 1691292,
    109: 1726717,
    110: 1782111,
    111: 1827492,
    112: 1887772,
    113: 1925853,
    114: 1986837,
    115: 2033674,
    116: 2089776,
    117: 2145333,
    118: 2197483,
    119: 2246640,
    120: 2332104,
    121: 2379085,
    122: 2434833,
    123: 2490534,
    124: 2554600,
    125: 2609625,
    126: 2693919,
    127: 2742052,
    128: 2813988,
    129: 2875245,
    130: 2952085,
    131: 3003306,
    132: 3096024,
    133: 3157249,
    134: 3224511,
    135: 3306240,
    136: 3388576,
    137: 3444609,
    138: 3533637,
    139: 3591322,
    140: 3693924,
    141: 3767085,
    142: 3842623,
    143: 3912324,
    144: 4027884,
    145: 4102093,
    146: 4181949,
    147: 4270422,
    148: 4361548,
    149: 4427853,
    150: 4548003,
    151: 4616104,
    152: 4718640,
    153: 4812789,
    154: 4918561,
    155: 5003286,
    156: 5131848,
    157: 5205481,
    158: 5299011,
    159: 5392008,
    160: 5521384,
    161: 5610705,
    162: 5739009,
    163: 5818390,
    164: 5930196,
    165: 6052893,
    166: 6156139,
    167: 6239472,
    168: 6402720,
    169: 6493681,
    170: 6623853,
    171: 6741078,
    172: 6864016,
    173: 6953457,
    174: 7094451,
    175: 7215016,
    176: 7359936,
    177: 7475145,
    178: 7593865,
    179: 7689630,
    180: 7886244,
    181: 7984165,
    182: 8130747,
    183: 8253888,
    184: 8403448,
    185: 8523897,
    186: 8684853,
    187: 8802826,
    188: 8949612,
    189: 9105537,
    190: 9267595,
    191: 9376656,
    192: 9574704,
    193: 9686065,
    194: 9827097,
    195: 9997134,
    196: 10174780,
    197: 10290813,
    198: 10493367,
    199: 10611772,
    200: 10813692
}

if __name__ == '__main__':
    k = int(input())

    print(prerecorded[k])


Measured memory_bytes: 9484