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 long long mod = 1e9 + 7;
const double eps = 1e-6;
int n, cnt;
bool check[100010];
long long prime[100010];
vector<pair<int, int> > ans;
vector<int> vv;
bool flag[100010];
void per() {
  check[1] = 1;
  for (int i = 2; i <= n; ++i) {
    if (!check[i]) {
      prime[++cnt] = i;
    }
    for (int j = 1; j <= cnt && prime[j] * i <= n; ++j) {
      check[i * prime[j]] = 1;
      if (i % prime[j] == 0) {
        break;
      }
    }
  }
}
int main() {
  scanf("%d", &n);
  per();
  for (int i = cnt; i >= 1; --i) {
    vector<int> vec;
    for (long long j = 1; j * prime[i] <= n; ++j) {
      if (!flag[j * prime[i]]) {
        vec.push_back(j * prime[i]);
      }
    }
    if (vec.size() % 2 == 0) {
      for (int k = 0; k + 1 < vec.size(); k += 2) {
        ans.push_back(make_pair(vec[k], vec[k + 1]));
        flag[vec[k]] = flag[vec[k + 1]] = 1;
      }
    } else if (vec.size() >= 3) {
      ans.push_back(make_pair(vec[0], vec[2]));
      flag[vec[0]] = flag[vec[2]] = flag[vec[1]] = 1;
      vv.push_back(vec[1]);
      for (int k = 3; k + 1 < vec.size(); k += 2) {
        ans.push_back(make_pair(vec[k], vec[k + 1]));
        flag[vec[k]] = flag[vec[k + 1]] = 1;
      }
    }
  }
  for (int i = 0; i + 1 < vv.size(); i += 2) {
    ans.push_back(make_pair(vv[i], vv[i + 1]));
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); ++i) {
    printf("%d %d\n", ans[i].first, ans[i].second);
  }
  return 0;
}