#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  if (n == 1 || n == 2)
    cout << -1 << '\n';
  else if (n == 3)
    cout << 210 << '\n';
  else {
    int orig = n;
    n -= 4;
    string s[6] = {"50", "80", "170", "20", "200", "110"};
    int x = n % 6;
    string ans = s[x];
    string zer = "";
    for (int i = 0; i < orig - ans.size() - 1; i++) zer += '0';
    cout << "1" + zer + ans << '\n';
  }
}
