#include <bits/stdc++.h>
using namespace std;
const string ostatak[] = {"170", "020", "200", "110", "050", "080"};
int n;
string s;
int main() {
  cin >> n;
  if (n < 3) {
    cout << -1 << endl;
  } else if (n == 3)
    cout << 210 << endl;
  else {
    cout << 1;
    for (int i = 1; i < n - 3; i++) cout << 0;
    cout << ostatak[n % 6] << endl;
  }
  return 0;
}
