#include <bits/stdc++.h>
using namespace std;
char suffix[6][4] = {"050", "080", "170", "020", "200", "110"};
int main(int argc, char *argv[]) {
  int n;
  cin >> n;
  if (n <= 2)
    cout << -1 << endl;
  else if (n == 3)
    cout << 210 << endl;
  else {
    cout << "1";
    for (int i = 4; i < n; ++i) cout << "0";
    cout << suffix[(n - 4) % 6] << endl;
  }
  return EXIT_SUCCESS;
}
