#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
template <typename X>
inline bool minimize(X& p, X q) {
  if (p <= q) return 0;
  p = q;
  return 1;
}
template <typename X>
inline bool maximize(X& p, X q) {
  if (p >= q) return 0;
  p = q;
  return 1;
}
const char rail[][5] = {"170", "020", "200", "110", "050", "080"};
int main() {
  int N;
  cin >> N;
  if (N <= 2)
    cout << "-1" << endl;
  else if (N == 3)
    cout << "210" << endl;
  else {
    cout << "1" << string(N - 4, '0') << rail[N % 6] << endl;
  }
  return 0;
}
