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;
bool comp[100010];
int P[100010];
int seive(int n, int* P) {
  int p, q, K = 0;
  comp[1] = true;
  char even = 1;
  for (p = 2; p * p <= n; p += 2) {
    if (!comp[p]) {
      for (q = p * p; q <= n; q += p * (2 - even)) comp[q] = true;
    }
    if (p == 2) --p, even = 0;
  }
  for (int i = (1); i <= (n); ++i)
    if (!comp[i]) P[K++] = i;
  return K;
}
int match[100010];
int main() {
  int N;
  cin >> N;
  vector<int> muls;
  int K = seive(N, P);
  int ans = 0;
  for (int i = (K - 1); i >= (0); --i) {
    muls.clear();
    muls.reserve((N + P[i] - 1) / P[i]);
    for (int v = 1, p = P[i]; p <= N; v++, p += P[i]) {
      if (!match[p]) muls.push_back(p);
    }
    assert(muls.size() >= 1);
    if (muls.size() == 1) continue;
    int M = muls.size();
    swap(muls[1], muls[M - 1]);
    int a, b;
    for (int j = 0; j < M - 1; j += 2) {
      a = muls[j], b = muls[j + 1];
      assert(a != b && 1 <= a && a <= N && 1 <= b && b <= N && !match[a] &&
             !match[b]);
      match[a] = b;
      match[b] = a;
      ans++;
    }
  }
  cout << ans << endl;
  for (int i = (1); i <= (N); ++i) {
    if (match[i] > i) printf("%d %d\n", i, match[i]);
  }
}