#include <bits/stdc++.h>
using namespace std;
int val[100050], cnt[100050], n;
void init() {
  val[4] = 5, cnt[4] = 50;
  for (int i = 5; i <= 100000; i++) {
    cnt[i] = cnt[i - 1] * 10 % 210;
  }
}
void output() {
  int t = 0;
  if (cnt[n] >= 100)
    t = 3;
  else if (cnt[n] >= 10)
    t = 2;
  else
    t = 1;
  printf("1");
  for (int i = 2; i <= n - t; i++) printf("0");
  printf("%d", cnt[n]);
  puts("");
}
int main() {
  init();
  while (~scanf("%d", &n)) {
    if (n < 3)
      puts("-1");
    else if (n == 3)
      puts("210");
    else if (n == 4)
      puts("1050");
    else
      output();
  }
  return 0;
}
