#include <bits/stdc++.h>
using namespace std;
int a[10000];
vector<int> ans[3000];
set<long long> uq;
int main() {
  int n;
  scanf("%d", &n);
  if (n == 1) {
    printf("-1\n");
  } else if (n < 4) {
    int ans = -1;
    for (int i = 1; i < 1000000; ++i) {
      if ((i % 2 == 0) && (i % 3 == 0) && (i % 5 == 0) && (i % 7 == 0)) {
        long long t = i;
        int num = 0;
        while (t) {
          ++num;
          t /= 10;
        }
        if (num == n) {
          ans = i;
          break;
        }
      }
    }
    printf("%d\n", ans);
  } else {
    int m = n - 2;
    int t = 10;
    for (int i = 0; i < m; ++i) {
      t = t % 7;
      t *= 10;
    }
    t /= 10;
    t = 7 - t;
    int ansnum = 0;
    int anst;
    for (int i = 0;; ++i) {
      int x = i * 7 + t;
      int num = 0;
      int c = 0;
      while (x) {
        num += x % 10;
        x /= 10;
        ++c;
      }
      if ((num + 1) % 3 == 0) {
        ansnum = i * 7 + t;
        anst = c;
        break;
      }
    }
    string ans = "1";
    for (int i = 0; i < m - anst; ++i) ans += "0";
    printf("%s%d0\n", ans.c_str(), ansnum);
  }
}
