#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int inf = (int)1e9;
const double inf1 = 1e-9;
const int ss = (int)1e6 + 3;
const int base = inf;
bool pred(const pair<long long int, long long int>& i,
          const pair<long long int, long long int>& j) {
  if (i.first == j.first)
    return i.second < j.second;
  else
    return i.first < j.first;
}
int mas[6] = {50, 80, 170, 20, 200, 110};
int kol[6] = {2, 2, 3, 2, 3, 3};
int main() {
  int n;
  scanf("%d", &n);
  if (n < 3) {
    cout << -1;
    return 0;
  }
  if (n == 3) {
    cout << 210;
    return 0;
  }
  int k = n - 4;
  k %= 6;
  cout << 1;
  for (int i = 0; i < n - 1 - kol[k]; ++i) cout << 0;
  cout << mas[k];
  return 0;
}
