#include <bits/stdc++.h>
using namespace std;
const int MAXN = 8;
const int MAXR = 1;
const int MAXC = 1;
const int MAXBITS = 64;
const int INF = (int)1e9;
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
priority_queue<int, vector<int>, greater<int>> q1;
priority_queue<int, vector<int>, less<int>> q2;
void l() { ; }
int arr[MAXN];
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  string sol[] = {"050", "080", "170", "020", "200", "110"};
  int n;
  cin >> n;
  if (n <= 2)
    cout << "-1\n";
  else if (n == 3)
    cout << 210 << "\n";
  else {
    int x = (n - 4) % 6;
    cout << 1;
    for (int i = 1; i < n - 3; ++i) cout << 0;
    cout << sol[x] << "\n";
  }
  return 0;
}
