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 inf = 0x3f3f3f3f;
const long long linf = 0x3f3f3f3f3f3f3f3f;
const int maxn = 1e6 + 11;
const int maxm = 2e3 + 11;
const double eps = 1e-4;
const int mod = 1e9 + 7;
inline long long rd() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline long long qpow(long long a, long long b, long long p) {
  long long res = 1;
  while (b) {
    if (b & 1) {
      res *= a;
      res %= p;
    }
    b >>= 1;
    a = a * a % p;
  }
  return res;
}
bool cmp(const int &a, const int &b) { return a > b; }
int prime[maxn];
vector<int> v;
int vis[maxn];
int ans[maxn][2];
int main() {
  for (int i = 2; i <= 1e5 + 11; i++) {
    if (prime[i]) continue;
    v.push_back(i);
    for (int j = i; j <= 1e5 + 11; j += i) {
      prime[j] = 1;
    }
  }
  sort(v.begin(), v.end(), cmp);
  vis[1] = 1;
  int n = rd(), len = 0;
  int lr = 0, rr = (int)v.size() - 1, pos = 0;
  while (lr <= rr) {
    int mid = lr + rr >> 1;
    if (v[mid] * 2 <= n) {
      pos = mid;
      rr = mid - 1;
    } else
      lr = mid + 1;
  }
  int tt = 2;
  for (int i = 1; i <= n; i++) vis[i] = 0;
  for (int j = pos; j < v.size(); j++) {
    int x = v[j];
    if (n / x < 2) continue;
    int l = 1, r = n / x;
    if (x == 2) tt = 1;
    if (r == 2) {
      ans[++len][0] = l * x, ans[len][1] = r * x;
      vis[l * x] = 1, vis[r * x] = 1;
      continue;
    }
    if (r % 2 == 0 && x != 2) r--;
    while (l <= r) {
      while (vis[l * x]) l += tt;
      while (vis[r * x]) r -= tt;
      if (l > r) break;
      if (l == r) {
        if (vis[(l + 1) * x] || vis[l * x]) break;
        vis[l * x] = 1;
        vis[(l + 1) * x] = 1;
        ans[++len][0] = l * x;
        ans[len][1] = (l + 1) * x;
        break;
      }
      ans[++len][0] = l * x, ans[len][1] = r * x;
      vis[l * x] = 1, vis[r * x] = 1;
      l += tt, r -= tt;
    }
  }
  printf("%d\n", len);
  for (int i = 1; i <= len; i++) {
    printf("%d %d\n", ans[i][0], ans[i][1]);
  }
}