#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  if (n == 1 || n == 2) {
    printf("-1");
    return 0;
  }
  if (n == 3) {
    printf("210\n");
    return 0;
  }
  long long int sum = 1;
  for (long long int i = 1; i <= (long long int)n - 1; i++)
    sum = (sum * 10) % 210;
  long long int k = 210 - sum;
  if ((k / 10) == 0) {
    printf("1");
    for (long long int i = 2; i <= (long long int)n - 1; i++) printf("0");
    printf("%lld", k);
    return 0;
  }
  if ((k / 100) == 0) {
    printf("1");
    for (long long int i = 2; i <= (long long int)n - 2; i++) printf("0");
    printf("%lld", k);
    return 0;
  }
  printf("1");
  for (long long int i = 2; i <= (long long int)n - 3; i++) printf("0");
  printf("%lld", k);
  return 0;
}
