#include <cstdio>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <map>
#include<vector>
#include<queue>
#include<bits/stdc++.h>
#define debug(x) cout <<#x<<" = "<<x<<endl
#define debug2(x, y) cout<<x<<" "<<y<<endl
#define gg cout <<"---------------QAQ---------------"<<endl
#define fi first
#define SZ(x) (int)x.size()
#define se second
#define pb push_back
#define inf 0x3f3f3f3f3f3f3f3f
#define lson l, m, rt<<1
#define rson m+1, r, rt<<1|1
#define PI acos(-1)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;
typedef pair<pii, ll> Pii;
template<class T> inline void read(T &x){
    x=0; char c=getchar(); int f=1;
    while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
    while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
const int N = 366666, maxn = 1666666;
void FAST(){ios::sync_with_stdio(false);cin.tie(0);}
const ll mod = 7;

int n;
ll ans[300];
void solve()
{
    scanf("%d", &n);
    printf("%lld\n", ans[n]);
}

void init()
{
//    for(int i = 1; i <= 200; ++i) {
//        for(int a = 1; a <= i; ++a)
//        for(int b = 1; b <= i; ++b)
//        for(int c = 1; c <= i; ++c) {
//            int tmp = __gcd(a, b);
//            tmp = __gcd(tmp, c);
//            ans[i] += tmp;
//        }
//    }
//    gg;
//    for(int i = 1;i <= 200; ++i)
//    printf("ans[%d] = %lld;\n", i, ans[i]);

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


}
int main()
{

    init();
//    int _;scanf("%d", &_);while(_--)
//    while(~scanf("%d", &n))
    solve();
	return 0;
}


Measured memory_bytes: 3828