#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using mti = vector<vector<int>>;
using vl = vector<ll>;
using mtl = vector<vector<ll>>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
int main() {
  ll a;
  cin >> a;
  for (int i = 1; i < (int)(10); i++) {
    for (int j = 1; j < (int)(10); j++) {
      if (i * j == a) {
        cout << i * j;
        return 0;
      }
    }
  }
  cout << "-1";
  return 0;
}
