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