#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
long long store[200005];
long long temp[] = {4, 7, 6, 1, 9, 0};
int main() {
  std::ios::sync_with_stdio(false);
  long long n, j;
  cin >> n;
  if (n <= 2) {
    cout << "-1" << endl;
    return 0;
  }
  if (n == 3) {
    cout << "210" << endl;
    return 0;
  }
  long long t = n;
  n = n - 3;
  j = 0;
  for (long long i = (long long)(0); i <= (long long)(n - 1); i++) {
    store[j++] = temp[i % 6];
  }
  long long sum, carry = 1;
  for (long long i = (long long)(n - 1); i >= (long long)(0); i--) {
    sum = (carry + store[i]) % 10;
    carry = (carry + store[i]) / 10;
    store[i] = sum;
  }
  carry = 0;
  v.push_back(store[n - 1]);
  long long prev = store[n - 1];
  for (long long i = (long long)(n - 2); i >= (long long)(0); i--) {
    sum = (prev * 2 + store[i] + carry) % 10;
    carry = (prev * 2 + store[i] + carry) / 10;
    v.push_back(sum);
    prev = store[i];
  }
  sum = (prev * 2 + carry) % 10;
  carry = (prev * 2 + carry) / 10;
  v.push_back(sum);
  if (carry) v.push_back(carry);
  long long sz = v.size();
  for (long long j = (long long)(sz - 1); j >= (long long)(0); j--) {
    cout << v[j];
  }
  cout << "0" << endl;
  return 0;
}
