#include <bits/stdc++.h>
using namespace std;
int n, k;
int main() {
  scanf("%d", &n);
  if (n == 3)
    printf("210");
  else if (n < 3)
    printf("-1");
  else {
    k = 1;
    for (long i = 0; i < n - 1; i++) k *= 10, k %= 210;
    printf("1%0*d", n - 1, 210 - k);
  }
  return 0;
}
