#include using namespace std; int main(int, char **) { int n; cin >> n; int ans[11] = {-1, 1, 100003, 100019, 100043, 100049, 100057, 100069, 100103, 100109, 100129}; cout << ans[n] << endl; return 0; }