#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n < 3) {
    cout << -1 << endl;
    return 0;
  }
  if (n == 3) {
    cout << 210 << endl;
    return 0;
  }
  if (n == 4) {
    cout << 1050 << endl;
    return 0;
  }
  int* dp = new int[n + 1];
  dp[4] = 50;
  int cow = 180;
  for (int i = 5; i <= n; i++) {
    if (dp[i - 1] >= cow)
      dp[i] = dp[i - 1] - cow;
    else
      dp[i] = dp[i - 1] + (210 - cow);
    cow = (cow * 10) % 210;
  }
  int digitCount;
  if (dp[n] == 0) digitCount = 1;
  if (dp[n] > 0 && dp[n] < 10) digitCount = 1;
  if (dp[n] > 9 && dp[n] < 100) digitCount = 2;
  if (dp[n] > 99) digitCount = 3;
  cout << "1";
  for (int i = 0; i < n - digitCount - 1; i++) cout << "0";
  cout << dp[n] << endl;
}
