#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100500;
const int INF = 1 << 30;
const int MOD = int(1e9) + 7;
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  if (n < 3) {
    cout << -1;
    return 0;
  }
  if (n == 3) {
    cout << 210;
    return 0;
  }
  int num = 1;
  for (int i = 2; i <= n; i++) num = (num * 10) % 210;
  num = 210 - num;
  cout << 1;
  for (int i = 1; i <= n - 4; i++) cout << 0;
  cout << num / 100 << num / 10 % 10 << num % 10;
  return 0;
}
