#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n < 3) {
    cout << -1;
    return 0;
  }
  if (n == 3) {
    cout << 210;
    return 0;
  }
  int A[] = {50, 80, 170, 20, 200, 110};
  int nA[] = {2, 2, 3, 2, 3, 3};
  int j = 0;
  for (int i = 4; i <= n; i++) {
    if (j == 6) j = 0;
    if (i == n) {
      cout << 1;
      for (int k = 1; k < n - nA[j]; k++) {
        cout << '0';
      }
      cout << A[j];
    }
    j++;
  }
  return 0;
}
