#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long mod1 = 998244353;
const long long N = 2e5 + 5;
const long long inf = 1e18;
const long long MAX = 4e5 + 5;
long long n;
string dp[MAX];
void solve() {
  cin >> n;
  if (n < 3) {
    cout << "-1";
    return;
  }
  if (n == 3) {
    cout << "210";
    return;
  }
  cout << "1";
  for (long long i = 0; i < n - 4; i++) {
    cout << "0";
  }
  long long num = 1;
  for (long long i = 0; i < n - 1; i++) {
    num *= 10;
    num %= 210;
  }
  num = 210 - num;
  if (num < 100) cout << "0";
  if (num < 10) cout << "0";
  cout << num;
}
int32_t main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  for (long long tt = 1; tt <= t; tt++) {
    solve();
  }
}
