#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  while (cin >> n) {
    long long x = 0, y = 1, i, num;
    if (n < 3) {
      cout << "-1" << endl;
      continue;
    }
    if (n == 3) {
      cout << "210" << endl;
      continue;
    }
    string ss = "1";
    for (i = 1; i < n; i++) ss += '0';
    for (i = 0; i < n; i++) {
      x = x * 10 + (ss[i] - 48);
      x %= 210;
    }
    x = 210 - x;
    num = x;
    while (x > 0) {
      y++;
      x /= 10;
    }
    n -= y;
    for (i = 0; i <= n; i++) cout << ss[i];
    cout << num << endl;
  }
  return 0;
}
