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