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