Problem: Jzzhu has picked n apples from his big apple tree. All the apples are numbered from 1 to n. Now he wants to sell them to an apple store. 

Jzzhu will pack his apples into groups and then sell them. Each group must contain two apples, and the greatest common divisor of numbers of the apples in each group must be greater than 1. Of course, each apple can be part of at most one group.

Jzzhu wonders how to get the maximum possible number of groups. Can you help him?

Input

A single integer n (1 ≤ n ≤ 105), the number of the apples.

Output

The first line must contain a single integer m, representing the maximum number of groups he can get. Each of the next m lines must contain two integers — the numbers of apples in the current group.

If there are several optimal answers you can print any of them.

Examples

Input

6


Output

2
6 3
2 4


Input

9


Output

3
9 3
2 4
6 8


Input

2


Output

0

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const double PI = 3.14159265;
vector<int> prime;
bool is_composite[100000009];
void sieve(int n) {
  fill(is_composite, is_composite + n, false);
  for (int i = 2; i < n; ++i) {
    if (!is_composite[i]) prime.push_back(i);
    for (int j = 0; j < prime.size() && i * prime[j] < n; ++j) {
      is_composite[i * prime[j]] = true;
      if (i % prime[j] == 0) break;
    }
  }
}
void yes() { cout << "YES" << '\n'; }
void no() { cout << "NO" << '\n'; }
bool cmp(const pair<int, string> &a, const pair<int, string> &b) {
  return (a.first > b.first);
}
long long int ceil(long long int x, long long int y) {
  return x % y ? x / y + 1 : x / y;
}
long long int power(long long int x, long long int y, long long int mo) {
  long long int r = 1;
  x = x % mo;
  while (y) {
    if (y & 1) r = (r * x % mo) % mo;
    y = y >> 1;
    x = ((x % mo) * (x % mo)) % mo;
  }
  return r % mo;
}
long long int gcd(long long int x, long long int y) {
  return y ? gcd(y, x % y) : x;
}
long long int fac(long long int x) { return (x ? x * fac(x - 1) : 1); }
long long int inv(long long int x, long long int y) {
  return (x * power(y, mod - 2, mod)) % mod;
}
long long int Twafiq(int n, int r) {
  long long int res = fac(n);
  long long int div = fac(n - r) * fac(r);
  div %= mod;
  div = power(div, mod - 2, mod);
  return (res * div) % mod;
}
long long int n, ans, vis[100010];
set<long long int> v[100010];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  cin >> n;
  sieve(1e5 + 10);
  for (auto p : prime) {
    if (p == 2 || p > n / 2) continue;
    for (int i = p; i <= n; i += p) {
      if (vis[i]) continue;
      v[p].insert(i);
      vis[i] = 1;
    }
    if (v[p].size() % 2) {
      v[p].erase(2 * p);
      vis[2 * p] = 0;
    }
    ans += v[p].size() / 2;
  }
  for (int i = 2; i <= n; i++) {
    if (vis[i] || i % 2) continue;
    if (is_composite[i] == 0 && i > n / 2) continue;
    v[2].insert(i);
  }
  if (v[2].size() % 2) v[2].erase(*v[2].begin());
  ans += v[2].size() / 2;
  cout << ans << '\n';
  for (auto p : prime) {
    if (p > n / 2) break;
    int cnt = 0;
    for (set<long long int>::iterator it = v[p].begin(); it != v[p].end();
         it++) {
      if (cnt % 2 == 0) cout << '\n';
      cout << *it << ' ';
      cnt++;
    }
  }
  return 0;
}