#include <bits/stdc++.h>
const int maxn = 100010;
char s[maxn];
using namespace std;
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    int i;
    if (n < 3)
      printf("-1\n");
    else if (n == 3)
      printf("210\n");
    else {
      int t = 50;
      for (i = 4; i < n; i++) {
        t *= 10;
        t %= 210;
      }
      int temp = t;
      int num = 0;
      while (temp) {
        temp /= 10;
        num++;
      }
      printf("1");
      for (i = num + 1; i < n; i++) printf("0");
      printf("%d\n", t);
    }
  }
}
