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;
int main() {
  int a[10000];
  bool vis[100010];
  int i, n, cnt[10000], ans = 0, m, j;
  memset(vis, 0, sizeof(vis));
  vis[1] = true;
  for (i = 2; i <= 100000; i++)
    for (j = i + i; j <= 100000; j += i) {
      vis[j] = true;
    }
  i = 0;
  j = 1;
  while (j <= 100000) {
    if (!vis[j]) a[++i] = j;
    j++;
  }
  a[i] = 100001;
  int as[100050], bs[100050];
  int tcnt[10000];
  memset(vis, 0, sizeof(vis));
  cin >> n;
  if (n < 3) {
    cout << 0 << endl;
    return 0;
  }
  for (i = 1; a[i] <= n; i++)
    ;
  m = i - 1;
  for (i = 1; i <= m; i++) tcnt[i] = cnt[i];
  int left = m, right = 2;
  int data;
  data = right;
  while (left--) {
    cnt[left] = 0;
    for (i = a[left]; i <= n; i += a[left])
      if (!vis[i]) cnt[left]++;
    bool flag = false;
    if (cnt[left] % 2 && right * a[left] <= n) {
      data = right;
      while (true) {
        if (right * a[left] > n) {
          flag = true;
          break;
        }
        if (vis[right * a[left]] || right % a[left] == 0 || vis[right])
          right++;
        else
          break;
      }
      if (!flag) {
        vis[right] = vis[right * a[left]] = true;
        ans++;
        as[ans] = right * a[left];
        bs[ans] = right;
        right++;
      }
    }
    right = data;
    while (vis[right]) right++;
    i = a[left];
    for (i = a[left]; i <= n; i += a[left])
      for (j = i + a[left]; j <= n; j += a[left])
        if (!vis[i] && !vis[j] && i != j) {
          ans++;
          as[ans] = i;
          bs[ans] = j;
          vis[i] = vis[j] = true;
          i = j;
        }
    if (left == 1) break;
  }
  cout << ans << endl;
  for (i = 1; i <= ans; i++) cout << as[i] << " " << bs[i] << endl;
  return 0;
}