#include <bits/stdc++.h>
int main() {
  int n, i, ans;
  scanf("%d", &n);
  for (i = 1, ans = 1; i < n; i++) ans = (ans * 10) % 210;
  ans = 210 - ans;
  if (n <= 2) {
    printf("-1");
    return 0;
  }
  if (n == 3) {
    printf("210");
    return 0;
  }
  printf("1");
  for (i = 0; i < n - 4; i++) printf("0");
  if (ans >= 100)
    printf("%d", ans);
  else if (ans >= 10)
    printf("0%d", ans);
  else
    printf("00%d", ans);
  return 0;
}
