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;
void read(long long &x) {
  x = 0;
  char c = getchar();
  int f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -f;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + c - '0';
    c = getchar();
  }
  x *= f;
  return;
}
long long maxt(long long a, long long b) { return a > b ? a : b; }
long long mint(long long a, long long b) { return a < b ? a : b; }
void write(long long x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x < 10) {
    putchar('0' + x);
    return;
  }
  write(x / 10);
  putchar(x % 10 + '0');
  return;
}
long long n, pri[100005], cnt, pnt;
bool vis[100005];
void pre() {
  for (int i = 2; i <= n; i++) {
    if (!vis[i]) pri[++cnt] = i;
    for (int j = 1; j <= cnt && pri[j] * i <= n; j++) {
      vis[pri[j] * i] = 1;
      if (i % pri[j] == 0) break;
    }
  }
  for (int i = 1; i <= cnt; i++)
    if (pri[i] <= (n >> 1)) pnt = i;
  memset(vis, 0, sizeof(vis));
  return;
}
int main() {
  read(n);
  pre();
  write(n + pnt - cnt - 1 >> 1);
  putchar('\n');
  for (int i = pnt; i >= 1; i--) {
    long long tmp = 0;
    long long gk = 0;
    while (gk * pri[i] <= n) gk++;
    gk--;
    for (int j = gk; j; j--)
      if (!vis[pri[i] * j]) {
        vis[pri[i] * j] = 1;
        tmp++;
        if (!(tmp == 2 && j == 2)) {
          write(pri[i] * j);
          if (tmp == 2)
            putchar('\n'), tmp = 0;
          else
            putchar(' ');
        } else {
          tmp--;
          vis[pri[i] * j] = 0;
        }
      }
  }
}