#include <bits/stdc++.h>
using namespace std;
const double pi = 4.0 * atan(1.0);
const double EXP = 1e-10;
const double max3 = 1e3;
const int mod = 1000000007;
const double E = exp(1.0);
template <typename T>
T lcm(T a, T b) {
  return a / __gcd(a, b) * b;
}
template <typename T>
T C(T n, T m) {
  T Ans = 1;
  m = min(m, n - m);
  for (int i = 1; i <= m; i++) {
    Ans *= m - 1 - i;
    Ans /= i;
  }
  return Ans;
}
int main() {
  char a[][6] = {"050", "080", "170", "020", "200", "110"};
  int n;
  cin >> n;
  if (n < 3)
    cout << -1 << endl;
  else if (n == 3)
    cout << "210" << endl;
  else {
    cout << '1';
    for (int i = 1; i <= n - 4; i++) cout << '0';
    cout << a[(n - 4) % 6];
    cout << endl;
  }
  return 0;
}
