#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int mod = 1, n;
  cin >> n;
  for (int i = 1; i < n; i++) mod = (mod * 10) % 210;
  if (n < 3) {
    cout << -1;
    return 0;
  }
  if (n == 3)
    cout << 210;
  else {
    mod = 210 - mod;
    int cnt;
    if (mod < 10)
      cnt = 1;
    else if (mod < 100)
      cnt = 2;
    else
      cnt = 3;
    int zero = n - (cnt + 1);
    cout << 1;
    while (zero--) cout << 0;
    cout << mod;
  }
  return 0;
}
