#include <bits/stdc++.h>
using namespace std;
long long int n;
int main() {
  cin >> n;
  if (n == 1 || n == 2) {
    cout << -1;
    exit(0);
  }
  if (n == 3) {
    cout << 210;
    exit(0);
  }
  string s = "1";
  for (int i = 1; i < n; i++) {
    s += '0';
  }
  s.pop_back();
  s.pop_back();
  if (n % 6 == 0) {
    s.pop_back();
    s.push_back('1');
    s.push_back('7');
    s.push_back('0');
  }
  if (n % 6 == 1) {
    s.push_back('2');
    s.push_back('0');
  }
  if (n % 6 == 2) {
    s.pop_back();
    s.push_back('2');
    s.push_back('0');
    s.push_back('0');
  }
  if (n % 6 == 3) {
    s.pop_back();
    s.push_back('1');
    s.push_back('1');
    s.push_back('0');
  }
  if (n % 6 == 4) {
    s.push_back('5');
    s.push_back('0');
  }
  if (n % 6 == 5) {
    s.push_back('8');
    s.push_back('0');
  }
  cout << s;
}
