#include <bits/stdc++.h>
using namespace std;

int main () {
    int N; cin >> N;

    int res = 0;
    for (int i = 1; !res && i << 12; i++) {
        int count = 0;
        for (int j = 1; j <= i; j++) {
            if (i % j == 0) count++;
        }
        if (count == N) res = i;
    }

    cout << res << endl;

    return 0;
}