#include <bits/stdc++.h>
using namespace std;
string v[6] = {"050", "080", "170", "020", "200", "110"};
long long int solve(int n) {
  int k;
  long long int i, p;
  for (i = 210, k = 3, p = 100; k < n; k++) {
    i *= 10;
    p *= 10;
  }
  while (i / p > 0) {
    i -= 210;
  }
  return i + 210;
}
int main() {
  int i, j, n;
  while (scanf("%d", &n) == 1) {
    if (n < 3)
      printf("-1\n");
    else {
      if (n == 3)
        printf("210\n");
      else {
        printf("1");
        for (i = n - 4, j = 0; i > 0; i--, j = (j + 1) % 6) putchar('0');
        cout << v[j] << endl;
      }
    }
  }
  return 0;
}
