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;
bool vis[100005];
vector<pair<int, int> > res;
vector<int> vec[100005];
vector<int> rem;
bool done[100005];
int n;
int main() {
  cin >> n;
  if (n <= 3) {
    puts("0");
  } else {
    int m = sqrt(100005 + 0.5);
    for (int i = 2; i <= m; i++) {
      if (vis[i]) continue;
      for (int j = i * i; j < 100005; j += i) {
        vis[j] = 1;
      }
    }
    for (int i = 3; i <= n; i++) {
      if (!vis[i]) {
        for (int j = i; j <= n; j += i) {
          if (!done[j]) {
            vec[i].push_back(j);
            done[j] = 1;
          }
        }
      }
    }
    for (int i = 2; i <= n; i *= 2) {
      rem.push_back(i);
    }
    for (int i = 3; i <= n; i++) {
      if (vis[i] || vec[i].size() <= 1) continue;
      if (vec[i].size() & 1) {
        for (int j = 3; j < vec[i].size(); j += 2) {
          res.push_back(make_pair(vec[i][j], vec[i][j + 1]));
        }
        res.push_back(make_pair(i, vec[i][2]));
        rem.push_back(2 * i);
      } else {
        for (int j = 0; j < vec[i].size(); j += 2) {
          res.push_back(make_pair(vec[i][j], vec[i][j + 1]));
        }
      }
    }
    for (int i = 0; i < rem.size(); i += 2) {
      if (i + 1 < rem.size()) {
        res.push_back(make_pair(rem[i], rem[i + 1]));
      }
    }
    printf("%d\n", res.size());
    for (int i = 0; i < res.size(); i++) {
      printf("%d %d\n", res[i].first, res[i].second);
    }
  }
  return 0;
}