#include using namespace std; int main(){ int n;cin >> n; vector a; a.push_back(1); for(long long i = 1;i<10;i++){ for(long long j = 1; j < 10; j++){ a.push_back((100000LL + i) * (100000LL + j)); } } sort(a.begin(), a.end()); cout << a[n] << endl; return 0; }