#include using namespace std; using ll = long long; constexpr ll ans[19] = { 3LL, 45LL, 513LL, 5625LL, 60633LL, 645705LL, 6811353LL, 71302185LL, 741719673LL, 7675477065LL, 79079293593LL, 811713642345LL, 8305422781113LL, 84748805030025LL, 862739245270233LL, 8764653207432105LL, 88881878866888953LL, 899936909802000585LL, 9099432188218005273LL, }; int main() { int P; cin >> P; cout << ans[P - 1] << endl; return 0; }