#include <bits/stdc++.h>
using namespace std;
void fun() {}
int32_t main() {
  fun();
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long a, b, c, d, num, g, l, ans, i, n, carry = 0, k = 3, x, size = 0;
  cin >> x;
  n = x;
  if (n < 3)
    cout << -1;
  else if (n == 3)
    cout << 210;
  else {
    i = 3;
    num = 10;
    while (i <= n) {
      num *= 10;
      num %= 210;
      i++;
    }
    num = 210 - num;
    n = num;
    while (num != 0) {
      size++;
      num /= 10;
    }
    cout << 1;
    for (i = 0; i < x - size - 1; i++) cout << 0;
    cout << n;
  }
}
