#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, mcm = 210;
  cin >> n;
  string term[] = {"05", "08", "17", "02", "20", "11"};
  if (n <= 2)
    cout << -1 << endl;
  else if (n == 3)
    cout << mcm << endl;
  else {
    cout << 1;
    for (int i = 0; i < (n - 4); i++) {
      cout << 0;
    }
    int end = (n + 2) % 6;
    cout << term[end] << 0 << endl;
  }
  return 0;
}
