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 int mod = 1e9 + 7;
const int N = 2e5 + 10;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3f;
inline int read() {
  static char buf[1000000], *p1 = buf, *p2 = buf;
  register int x = false;
  register char ch =
      p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2)
          ? EOF
          : *p1++;
  ;
  register bool sgn = false;
  while (ch != '-' && (ch < '0' || ch > '9'))
    ch = p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2)
             ? EOF
             : *p1++;
  ;
  if (ch == '-')
    sgn = true,
    ch = p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2)
             ? EOF
             : *p1++;
  ;
  while (ch >= '0' && ch <= '9')
    x = (x << 1) + (x << 3) + (ch ^ 48),
    ch = p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2)
             ? EOF
             : *p1++;
  ;
  return sgn ? -x : x;
}
long long fpow(long long a, int b, int mod) {
  long long res = 1;
  for (; b > 0; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
int vis[N];
int use[N];
int p[N];
int cnt;
void isprime() {
  vis[1] = 1;
  for (int i = 2; i <= 200000; i++) {
    if (vis[i]) continue;
    p[++cnt] = i;
    for (int j = 2 * i; j <= 200000; j += i) {
      vis[j] = 1;
    }
  }
}
int main() {
  isprime();
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    use[i] = 0;
  }
  vector<pair<int, int>> ans;
  for (int i = n; i >= 3; i--) {
    if (vis[i]) continue;
    vector<int> now;
    for (int j = 2 * i; j <= n; j += i) {
      if (!use[j]) now.push_back(j);
    }
    now.push_back(i);
    if (now.size() % 2 != 0) now.erase(now.begin());
    for (int i = 0; i < (int)now.size() - 1; i += 2) {
      use[now[i]] = use[now[i + 1]] = 1;
      ans.push_back({now[i], now[i + 1]});
    }
  }
  vector<int> now;
  for (int i = 2; i <= n; i++) {
    if (!use[i] && i % 2 == 0) {
      now.push_back(i);
    }
  }
  for (int i = 0; i < (int)now.size() - 1; i += 2) {
    use[now[i]] = use[now[i + 1]] = 1;
    ans.push_back({now[i], now[i + 1]});
  }
  cout << ans.size() << endl;
  for (auto &i : ans) {
    printf("%d %d\n", i.first, i.second);
  }
  return 0;
}