#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long n;
  cin >> n;
  if (n < 3)
    cout << -1;
  else if (n == 3)
    cout << 210;
  else {
    string s = "";
    int cn = n;
    n -= 4;
    n %= 6;
    if (n == 0) s = "50";
    if (n == 1) s = "80";
    if (n == 2) s = "170";
    if (n == 3) s = "20";
    if (n == 4) s = "200";
    if (n == 5) s = "110";
    cout << 1;
    for (int(i) = 0; i < (cn - s.size() - 1); i++) cout << "0";
    cout << s;
  }
}
