#include <bits/stdc++.h>
using namespace std;
int n;
int mkq[100010];
int dkbreak;
void dequy(int chay, int sodu) {
  int i;
  int bd;
  if (chay == n) {
    if (sodu == 0) {
      dkbreak = 1;
    }
    return;
  }
  bd = 0;
  if (chay == 0) {
    bd = 1;
  }
  for (i = bd; i <= 9; i++) {
    mkq[chay] = i;
    dequy(chay + 1, (sodu * 10 + i) % 21);
    if (dkbreak == 1) {
      return;
    }
  }
}
void solve() {
  n--;
  dkbreak = 0;
  dequy(0, 0);
}
void output() {
  int i;
  if (n < 2) {
    printf("-1\n");
    return;
  }
  for (i = 0; i < n; i++) {
    printf("%d", mkq[i]);
  }
  printf("0\n");
}
int main() {
  while (scanf("%d", &n) > 0) {
    solve();
    output();
  }
  return 0;
}
