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 long long MOD = 1000000007;
const int maxn = 100011;
queue<pair<int, int> > prt;
int a[maxn];
int prime[maxn];
bool b[maxn];
bool bb[maxn];
int n;
int k = 0;
void isP() {
  for (int i = 2; i <= n / 2; ++i)
    if (!b[i]) {
      prime[k++] = i;
      for (int j = i * 2; j < n; j += i) b[j] = 1;
    }
}
int main() {
  memset(a, 0, sizeof a);
  cin >> n;
  isP();
  while (prime[k - 1] > n / 2) k--;
  for (int j = k - 1; j >= 0; j--) {
    int p = prime[j];
    a[p] += n / p;
    for (int i = 0; i <= j - 1; ++i)
      if (a[p] / prime[i])
        a[prime[i]] -= a[p] / prime[i];
      else
        break;
    if (!j) break;
    int i;
    if (a[p] % 2) {
      a[2]++;
      for (i = 1; i < n / p; ++i) {
        if (i == 2) continue;
        if (bb[i * p]) continue;
        int j;
        for (j = i + 1; j <= n / p; j++) {
          if (j == 2) continue;
          if (bb[j * p])
            continue;
          else {
            prt.push(make_pair(i * p, j * p));
            bb[i * p] = bb[j * p] = 1;
            break;
          }
        }
        i = j;
      }
    } else {
      for (i = 1; i < n / p; i++) {
        if (bb[i * p]) continue;
        int j;
        for (j = i + 1; j <= n / p; j++) {
          if (bb[j * p])
            continue;
          else {
            prt.push(make_pair(i * p, j * p));
            bb[i * p] = bb[j * p] = 1;
            break;
          }
        }
        i = j;
      }
    }
  }
  if (n >= 4) {
    prt.push(make_pair(2, 4));
  }
  for (int i = 3; i < n / 2; ++i) {
    if (bb[i * 2]) continue;
    int j;
    for (j = i + 1; j <= n / 2; ++j)
      if (bb[j * 2])
        continue;
      else {
        prt.push(make_pair(i * 2, j * 2));
        break;
      }
    i = j;
  }
  printf("%d\n", prt.size());
  while (!prt.empty()) {
    pair<int, int> temp = prt.front();
    prt.pop();
    printf("%d %d\n", temp.first, temp.second);
  }
}