#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T gcd(T a, T b) {
  return b == 0 ? a : gcd(b, a % b);
}
template <class T>
inline T lcm(T a, T b) {
  return (a / gcd(a, b)) * b;
}
int main() {
  int n;
  int d = 210;
  cin >> n;
  if (n < 3) {
    cout << -1 << endl;
    return 0;
  }
  if (n == 3) {
    cout << 210 << endl;
    return 0;
  }
  cout << 1;
  int m = 1;
  for (int i = 0; i < (n - 1); i++) {
    m *= 10;
    m %= 210;
    if (i < n - 4) cout << 0;
  }
  int r = 210 - m;
  if (r < 10)
    cout << 00 << r << endl;
  else if (r < 100)
    cout << 0 << r << endl;
  else
    cout << r << endl;
  return 0;
}
