#include <iostream>

using namespace std;

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

  for (int i = 1; ;i++) {
    count = 0;
    for (int j = 1; j <= i/2; j++) {
      if (!(i % j)) count++;
    }
    if (count == N - 1) {
      cout << i << endl;
      break;
    }
  }
}

