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