#include <bits/stdc++.h>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
long long n,t=0;
cin>>n;
for(long long i=1;;i++){
for(long long j=1;j<=i;j++){
if(i%j==0){
t++;
}
}
if(t==n){
cout<<i;
return 0;
}else{
t=0;
}
}
return 0;
}