#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <cstdio>
#include <numeric>



int gcd(int a, int b)
{
    if (a % b == 0)
    {
        return(b);
    }
    else
    {
        return(gcd(b, a % b));
    }
}

int gcd(int a, int b, int c) {
    return gcd(gcd(a,b),c);
}

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

Measured memory_bytes: 3652