#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 7;
long long used[MAXN];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  if (n == 1 || n == 2) {
    cout << -1;
    return 0;
  } else if (n == 3) {
    cout << 210;
    return 0;
  }
  used[2] = 4;
  used[3] = 5;
  used[4] = 1;
  used[5] = 3;
  used[6] = 2;
  used[7] = 6;
  for (int i = 8; i < MAXN; i++) {
    used[i] = used[i - 6];
  }
  for (int i = 10; i < 1000000; i += 10) {
    int sum = 1;
    int d = i;
    while (d > 0) {
      sum += d % 10;
      d /= 10;
    }
    if (i % 7 == used[n] && sum % 3 == 0) {
      int len = 0;
      int chislo = i;
      while (chislo > 0) {
        chislo /= 10;
        len++;
      }
      cout << 1;
      int j = 0;
      while (j < n - len - 1) {
        cout << 0;
        j++;
      }
      cout << i;
      break;
    }
  }
  return 0;
}
