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>
char READ_DATA;
int SIGNAL_INPUT;
template <typename Type>
inline void read(Type &v) {
  SIGNAL_INPUT = 1;
  while ((READ_DATA = getchar()) < '0' || READ_DATA > '9')
    if (READ_DATA == '-') SIGNAL_INPUT = -1;
  v = READ_DATA - '0';
  while ((READ_DATA = getchar()) >= '0' && READ_DATA <= '9')
    v = v * 10 + READ_DATA - '0';
  v *= SIGNAL_INPUT;
}
struct Edge {
  int v, next;
  Edge(int _v = 0, int nxt = 0) {
    v = _v;
    next = nxt;
  }
};
using namespace std;
const long long LINF = 1LL << 62;
const int INF = 1 << 30;
const int mod = 1e9 + 7;
const int maxn = 2e5 + 5;
int n, p[maxn], vis[maxn], cnt;
int ans;
int ans1[maxn], ans2[maxn];
void sieve(int n) {
  for (int i = 2; i <= n; ++i) {
    if (!vis[i]) {
      vis[i] = 1;
      p[++cnt] = i;
      if (i < 320)
        for (int j = i * i; j <= n; j += i) {
          vis[j] = 1;
        }
    }
  }
}
vector<int> r;
int main() {
  read(n);
  sieve(n / 2);
  memset(vis, 0, sizeof(vis));
  int a, b, c;
  long long k;
  for (int i = cnt; i > 1; --i) {
    c = 0;
    for (int j = 1; j * p[i] <= n; ++j) {
      if (!vis[j * p[i]]) ++c;
    }
    if (c > 1) {
      if (c & 1) {
        a = b = 0;
        for (int j = 1; j * p[i] <= n; ++j) {
          if (j == 2) continue;
          if (!a) {
            if (!vis[p[i] * j]) vis[a = p[i] * j] = 1;
          } else if (!b) {
            if (!vis[p[i] * j]) vis[b = p[i] * j] = 1;
          }
          if (a && b) {
            ++ans;
            ans1[ans] = a;
            ans2[ans] = b;
            a = b = 0;
          }
        }
        vis[a] = vis[b] = 0;
        a = b = 0;
      } else {
        a = b = 0;
        for (int j = 1; j * p[i] <= n; ++j) {
          if (!a) {
            if (!vis[p[i] * j]) vis[a = p[i] * j] = 1;
          } else if (!b) {
            if (!vis[p[i] * j]) vis[b = p[i] * j] = 1;
          }
          if (a && b) {
            ++ans;
            ans1[ans] = a;
            ans2[ans] = b;
            a = b = 0;
          }
        }
        vis[a] = vis[b] = 0;
        a = b = 0;
      }
    }
  }
  a = b = 0;
  for (int j = 1; 2 * j <= n; ++j) {
    if (!a) {
      if (!vis[2 * j]) vis[a = 2 * j] = 1;
    } else if (!b) {
      if (!vis[2 * j]) vis[b = 2 * j] = 1;
    }
    if (a && b) {
      ++ans;
      ans1[ans] = a;
      ans2[ans] = b;
      a = b = 0;
    }
  }
  printf("%d\n", ans);
  for (int i = 1; i <= ans; ++i) {
    printf("%d %d\n", ans1[i], ans2[i]);
  }
}