#include <bits/stdc++.h>
using namespace std;
int a[10] = {50, 80, 170, 20, 200, 110};
int b[10] = {2, 2, 3, 2, 3, 3};
int n;
int main() {
  scanf("%d", &n);
  if (n < 3)
    printf("-1\n");
  else if (n == 3)
    printf("210\n");
  else {
    printf("1");
    int t = (n + 2) % 6;
    for (int i = 2; i <= n - b[t]; i++) printf("0");
    printf("%d\n", a[t]);
  }
}
