#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, f_digit, add[] = {2, 5, 8, 11, 14, 17, 20}, mod[] = {5, 1, 3, 2, 6, 4};
  scanf("%d", &n);
  if (n < 3)
    printf("-1\n");
  else {
    if (n == 3)
      printf("210\n");
    else {
      n -= 3;
      printf("1");
      for (int i = 1; i < n; i++) {
        printf("0");
      }
      f_digit = mod[n % 6] * 100;
      for (int i = 0; i < 7; i++) {
        if ((f_digit + add[i]) % 7 == 0) {
          if (add[i] == 8 || add[i] == 2 || add[i] == 5) printf("0");
          printf("%d0\n", add[i]);
          break;
        }
      }
    }
  }
  return 0;
}
