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;
template <class T>
T sqr(T x) {
  return x * x;
}
template <class T>
T gcd(T a, T b) {
  return (b != 0 ? gcd<T>(b, a % b) : a);
}
template <class T>
T lcm(T a, T b) {
  return (a / gcd<T>(a, b) * b);
}
template <class T>
inline T bigmod(T p, T e, T M) {
  if (e == 0) return 1;
  if (e % 2 == 0) {
    long long int t = bigmod(p, e / 2, M);
    return (T)((t * t) % M);
  }
  return (T)((long long int)bigmod(p, e - 1, M) * (long long int)p) % M;
}
template <class T>
inline T bigexp(T p, T e) {
  if (e == 0) return 1;
  if (e % 2 == 0) {
    long long int t = bigexp(p, e / 2);
    return (T)((t * t));
  }
  return (T)((long long int)bigexp(p, e - 1) * (long long int)p);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
int dx4[] = {1, 0, -1, 0};
int dy4[] = {0, 1, 0, -1};
int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy8[] = {0, 1, 1, 1, 0, -1, -1, -1};
int month[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int n, p[100005], pp[100005], c, c1, q;
bool a[100005], bl[100005];
pair<int, int> ppp[100005];
int main() {
  scanf("%d", &n);
  p[1] = 2;
  c1++;
  int sq = sqrt((n / 2) + 1), u;
  for (int i = 3; i <= sq; i += 2) {
    if (a[i] == false) {
      for (int j = i * i; j <= n / 2; j += (2 * i)) a[j] = true;
    }
  }
  for (int i = 3; i <= n / 2; i += 2)
    if (a[i] == false) p[++c1] = i;
  for (int i = 2; i <= c1; i++) {
    u = 0;
    for (int j = p[i]; j <= n; j += p[i]) {
      if (!bl[j]) {
        pp[++u] = j;
      }
    }
    if (u % 2 != 0) {
      pp[2] = pp[1];
      for (int k = 2; k <= u; k += 2) {
        ppp[++c].first = pp[k];
        ppp[c].second = pp[k + 1];
        bl[pp[k]] = true;
        bl[pp[k + 1]] = true;
      }
    } else {
      for (int k = 1; k <= u; k += 2) {
        ppp[++c].first = pp[k];
        ppp[c].second = pp[k + 1];
        bl[pp[k]] = true;
        bl[pp[k + 1]] = true;
      }
    }
  }
  c1 = 0;
  for (int i = 2; i <= n; i += 2)
    if (!bl[i]) pp[++c1] = i;
  if (c1 % 2 == 0)
    for (int k = 1; k <= c1; k += 2) {
      ppp[++c].first = pp[k];
      ppp[c].second = pp[k + 1];
    }
  else if (c1 % 2 != 0)
    for (int k = 1; k <= c1 - 1; k += 2) {
      ppp[++c].first = pp[k];
      ppp[c].second = pp[k + 1];
    }
  printf("%d\n", c);
  for (__typeof(c) i = (1); i <= (c); i++)
    printf("%d %d\n", ppp[i].first, ppp[i].second);
  return 0;
}