#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
string large_al = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string small_al = "abcdefghijklmnopqrstuvwxyz";
using Graph = vector<vector<int>>;
using i64 = int64_t;
int main() {
  int k;
  cin >> k;
  string s1 = "111212152215121#1515221#2254141";
  if (1 <= k <= 15) {
    cout << s1.at(k - 1) << endl;
  } else if (k == 16) {
    cout << 14 << endl;
  } else if (17 <= k <= 23) {
    cout << s1.at(k - 1) << endl;
  } else if (k == 24) {
    cout << 15 << endl;
  } else if (25 <= k <= 31) {
    cout << s1.at(k - 1) << endl;
  } else {
    cout << 51 << endl;
  }
}
