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 isnp[100005], used[100005], used1[100005];
int match[100005];
int pair1[100005], pair2[100005], cntp;
int pair11[100005], pair21[100005], cntp1;
int badmat[100005], badcnt;
int main() {
  int i, j, n;
  int cur = 0, stpar;
  scanf("%d", &n);
  for (i = 2; i <= n; i++) {
    if (isnp[i]) continue;
    cur = i;
    for (j = i + i; j <= n; j += i) {
      isnp[j] = true;
      if (cur <= 0 && !used1[j]) {
        cur = j;
      } else if (!used1[j]) {
        pair11[cntp1] = cur;
        pair21[cntp1] = j;
        used1[j] = true;
        used1[cur] = true;
        cntp1++;
        cur = 0;
      }
    }
  }
  for (i = n; i >= 2; i--) {
    if (isnp[i]) continue;
    cur = i;
    stpar = 0;
    for (j = i + i; j <= n; j += i) {
      isnp[j] = true;
      if (cur <= 0 && !used[j]) {
        cur = j;
      } else if (!used[j]) {
        pair1[cntp] = cur;
        pair2[cntp] = j;
        used[j] = true;
        used[cur] = true;
        if (stpar == 0) stpar = cntp;
        cntp++;
        cur = 0;
      }
    }
    if (cur > 0 && stpar > 0) {
      used[pair2[stpar]] = false;
      pair2[stpar] = cur;
      used[cur] = true;
    }
  }
  if (cntp > cntp1) {
    printf("%d\n", cntp);
    for (i = 0; i < cntp; i++) {
      printf("%d %d\n", pair1[i], pair2[i]);
    }
  } else {
    printf("%d\n", cntp1);
    for (i = 0; i < cntp1; i++) {
      printf("%d %d\n", pair11[i], pair21[i]);
    }
  }
  return 0;
}