#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9;
int main() {
  int n;
  scanf("%d", &n);
  if (n < 3)
    printf("-1\n");
  else if (n == 3)
    printf("210\n");
  else {
    int deb;
    if (n % 3 == 0)
      deb = 100;
    else if (n % 3 == 1)
      deb = 1;
    else
      deb = 10;
    if (((n - 1) / 3) % 2 == 1) deb = -deb;
    int fin;
    for (fin = 0; fin < 100; fin++)
      if (fin % 3 == 2 && abs(deb + fin * 10) % 7 == 0) break;
    printf("1");
    for (int i = 0; i < n - 4; i++) printf("0");
    printf("%03d\n", fin * 10);
  }
  return 0;
}
