#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int r = 1;
  if (n < 3) {
    cout << -1;
    return 0;
  }
  if (n == 3) {
    cout << 210;
    return 0;
  }
  for (int i = 2; i <= n; i++) {
    r *= 10;
    r = r % 210;
  }
  if (210 - r < 10)
    for (int i = 1; i <= n - 1; i++) {
      if (i == 1)
        cout << 1;
      else
        cout << 0;
    }
  else if (210 - r < 100)
    for (int i = 1; i <= n - 2; i++) {
      if (i == 1)
        cout << 1;
      else
        cout << 0;
    }
  else if (210 - r < 1000)
    for (int i = 1; i <= n - 3; i++) {
      if (i == 1)
        cout << 1;
      else
        cout << 0;
    }
  cout << 210 - r << endl;
}
