#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n < 3)
    cout << "-1";
  else if (n == 3)
    cout << "210";
  else {
    int k;
    if (n % 3 == 0) k = 100;
    if (n % 3 == 1) k = 1;
    if (n % 3 == 2) k = 10;
    if (((n - 1) / 3) % 2 == 0) k = -k;
    int min = 0;
    for (int l = 0; min == 0; l += 10) {
      if (abs(l - k) % 7 == 0 && (l + 1) % 3 == 0) min = l;
    }
    cout << "1";
    for (int i = 1; i <= n - 4; i++) cout << "0";
    if (min < 100) cout << "0";
    if (min < 10) cout << "0";
    cout << min;
  }
}
