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;
vector<int> prime, fact[100100];
map<int, int> slot;
int G(int a, int b) {
  if (a < b) swap(a, b);
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
void pre_compute() {
  prime.push_back(2);
  slot[2] = 0;
  int i, j;
  for (i = 3; i < 100100; i++) {
    for (j = 0; j < prime.size(); j++) {
      if (i % prime[j] == 0) {
        break;
      } else if (prime[j] * prime[j] > i) {
        j = prime.size();
        break;
      }
    }
    if (j == prime.size()) {
      slot[i] = prime.size();
      prime.push_back(i);
    }
  }
}
int calc(int n) {
  int i, j, N = n, cnt = 0;
  for (i = 0; i < prime.size(); i++) {
    if (n % prime[i] == 0) {
      cnt++;
      fact[N].push_back(slot[prime[i]]);
      while (n % prime[i] == 0) {
        n /= prime[i];
      }
    } else if (prime[i] * prime[i] > n && n != 1) {
      fact[N].push_back(slot[n]);
      cnt++;
      return cnt;
    } else if (n == 1) {
      return cnt;
    }
  }
  return cnt;
}
int main() {
  pre_compute();
  int i, j, k, n, ele, mn, id, cnt;
  set<pair<int, int> > s, srch[100100];
  set<pair<int, int> >::iterator it1, it2;
  vector<pair<int, int> > v;
  scanf("%d", &n);
  for (i = 2; i <= n; i++) {
    cnt = calc(i);
    for (j = 0; j < fact[i].size(); j++) {
      srch[fact[i][j]].insert(make_pair(cnt, i));
    }
    s.insert(make_pair(cnt, i));
  }
  pair<int, int> ii, jj;
  it1 = s.begin();
  while (it1 != s.end()) {
    ii = *it1;
    ele = ii.second;
    mn = 100000000;
    id = -1;
    for (i = 0; i < fact[ele].size(); i++) {
      srch[fact[ele][i]].erase(ii);
      if (srch[fact[ele][i]].size() > 0) {
        it2 = srch[fact[ele][i]].begin();
        jj = *it2;
        if (jj.first < mn) {
          mn = jj.first;
          id = jj.second;
        }
      }
    }
    if (id == -1) {
      s.erase(ii);
    } else {
      v.push_back(make_pair(ii.second, id));
      for (i = 0; i < fact[id].size(); i++) {
        srch[fact[id][i]].erase(make_pair(mn, id));
      }
      s.erase(ii);
      s.erase(make_pair(mn, id));
    }
    it1 = s.begin();
  }
  printf("%d\n", v.size());
  for (i = 0; i < v.size(); i++) {
    printf("%d %d\n", v[i].first, v[i].second);
  }
}