#include <bits/stdc++.h>
using namespace std;
long n;
string s;
string tong(string s1, string s2) {
  while (s1.length() < s2.length()) s1 = '0' + s1;
  while (s2.length() < s1.length()) s2 = '0' + s2;
  long tmp, i, mem;
  mem = 0;
  for (i = s1.length() - 1; i >= 0; i--) {
    tmp = s1[i] + s2[i] - 2 * '0' + mem;
    mem = tmp / 10;
    tmp = tmp % 10;
    s1[i] = char(tmp + '0');
  }
  if (mem == 1) s1 = '1' + s1;
  return s1;
}
int du(string s1) {
  long mem, i, tmp;
  tmp = 0;
  for (i = 0; i < s1.length(); i++) {
    tmp = tmp * 10 + (s1[i] - '0');
    tmp = tmp % 7;
  }
  return tmp;
}
int main() {
  string ts, ss, fs;
  cin >> n;
  if (n <= 2) {
    cout << -1;
    return 0;
  }
  ts = "";
  for (long i = 1; i <= n / 300; i++)
    ts = ts +
         "000000000000000000000000000000000000000000000000000000000000000000000"
         "000000000000000000000000000000000000000000000000000000000000000000000"
         "000000000000000000000000000000000000000000000000000000000000000000000"
         "000000000000000000000000000000000000000000000000000000000000000000000"
         "000000000000000000000000";
  for (long i = 1; i <= n % 300; i++) ts = ts + '0';
  s = ts;
  s[0] = '1';
  s[s.length() - 2] = '2';
  while (du(s) != 0) {
    ss = ts;
    ss[ss.length() - 2] = '3';
    fs = tong(s, ss);
    s = fs;
  }
  cout << s;
  return 0;
}
