#include <bits/stdc++.h>
int main() {
  int pos;
  scanf("%d", &pos);
  if (pos < 3)
    printf("-1");
  else if (pos == 3)
    printf("210");
  else {
    printf("1");
    if ((pos - 4) % 6 == 0) {
      for (int i = 0; i < pos - 3; i++) printf("0");
      printf("5");
      printf("0");
    } else if ((pos - 4) % 6 == 1) {
      for (int i = 0; i < pos - 3; i++) printf("0");
      printf("8");
      printf("0");
    } else if ((pos - 4) % 6 == 2) {
      for (int i = 0; i < pos - 4; i++) printf("0");
      printf("17");
      printf("0");
    } else if ((pos - 4) % 6 == 3) {
      for (int i = 0; i < pos - 3; i++) printf("0");
      printf("2");
      printf("0");
    } else if ((pos - 4) % 6 == 4) {
      for (int i = 0; i < pos - 4; i++) printf("0");
      printf("20");
      printf("0");
    } else {
      for (int i = 0; i < pos - 4; i++) printf("0");
      printf("11");
      printf("0");
    }
  }
}
