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 maxn = 5e5 + 7;
const long long mod = 1e9 + 7;
const long long INF = 1e9 + 7;
const long long mlog = 20;
const long long SQ = 400;
long long mark[maxn];
long long match[maxn];
vector<long long> dv[maxn];
vector<long long> primes, opt;
vector<long long> res;
vector<pair<long long, long long> > sol;
void groupUP() {
  for (long long ind = 0; ind < res.size(); ind += 2) {
    if (ind + 1 < res.size()) {
      sol.push_back({res[ind], res[ind + 1]});
      match[res[ind]] = match[res[ind + 1]] = true;
    }
  }
  res.clear(), opt.clear();
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(), cout.tie();
  ;
  long long n;
  cin >> n;
  for (long long i = 2; i <= n; i++) {
    if (mark[i]) continue;
    if (i * 2 > n) break;
    primes.push_back(i);
    for (long long j = i; j <= n; j += i) mark[j] = true, dv[i].push_back(j);
  }
  for (long long i = 1; i < primes.size(); i++) {
    long long cnt = 0;
    for (long long x : dv[primes[i]])
      if (!match[x]) cnt++, opt.push_back(x);
    if (cnt % 2 == 1) {
      for (long long i = 0; i < opt.size(); i++) {
        if (i == 1) continue;
        res.push_back(opt[i]);
      }
    } else {
      for (long long x : opt) res.push_back(x);
    }
    groupUP();
  }
  for (long long i = 2; i <= n; i += 2)
    if (!match[i]) res.push_back(i);
  groupUP();
  cout << sol.size() << "\n";
  for (auto gp : sol) cout << gp.first << " " << gp.second << "\n";
  return 0;
}