#include <bits/stdc++.h>
void fileio_in_out() {
  freopen(".in", "r", stdin);
  freopen(".out", "w", stdout);
}
void fileio_txt() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
int n, ans, t;
int i, j, k, l;
int f(int k) {
  int i, t = 1;
  for (i = 1; i <= k; i++) t = (t * 10) % 210;
  return t;
}
int main() {
  scanf("%d", &n);
  if (n <= 3)
    printf("%d\n", (n == 3) ? 210 : -1);
  else {
    printf("1");
    for (i = 1; i < n - 3; i++) printf("0");
    t = 210 - f(n - 1);
    if (t < 100) printf("0");
    printf("%d\n", t);
  }
  return 0;
}
