#include <bits/stdc++.h>
const int MAXN = (int)5e5 + 5;
const int MODN = (int)1e9 + 7;
const double eps = (double)1e-7;
const double pi = (double)acos(-1.0);
int inf = 0x3f3f3f3f;
using namespace std;
int a[10] = {6, 4, 5, 1, 3, 2};
int cc(int num) {
  int count = 0;
  while (num != 0) {
    num /= 10;
    count++;
  }
  return count;
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  if (n == 1 || n == 2) {
    printf("-1\n");
  } else if (n == 3) {
    printf("210\n");
  } else {
    int index = (n - 4) % 6;
    int m = 20;
    for (int i = 1; i < 10000; i++) {
      if (m % 7 + a[index] == 7) {
        break;
      } else {
        m += 30;
      }
    }
    int num = cc(m);
    printf("1");
    for (int i = 0; i < n - 1 - num; i++) {
      printf("0");
    }
    printf("%d\n", m);
  }
}
