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>
int sew[111111];
int o[111111];
int oc;
int all[111111];
int allc;
int paired[111111];
int n;
int main() {
  scanf("%d", &n);
  if (n <= 3) {
    printf("0\n");
    return 0;
  }
  for (int i = 2; i <= n; i++) {
    if (sew[i] == 0) {
      o[oc++] = allc;
      for (int j = i; j <= n; j += i) {
        if (sew[j] == 0) all[allc++] = j;
        sew[j] = 1;
      }
    }
  }
  o[oc++] = allc;
  for (int i = o[1] - 1; i > 0; i -= 2) {
    paired[all[i]] = all[i - 1];
    paired[all[i - 1]] = all[i];
  }
  int m = (o[1] - o[0]) / 2;
  for (int i = 1; i < oc - 1; i++) {
    int p = all[o[i]];
    if (p * 2 <= n) {
      if (o[i + 1] - o[i] > 1) {
        for (int j = o[i + 1] - 1; j > o[i]; j -= 2) {
          paired[all[j]] = all[j - 1];
          paired[all[j - 1]] = all[j];
        }
        m += (o[i + 1] - o[i]) / 2;
      }
      if (!paired[p]) {
        if (!paired[2]) {
          paired[2] = paired[2 * p];
          paired[p] = 2 * p;
          paired[2 * p] = p;
          paired[paired[2]] = 2;
          m++;
        } else {
          if (paired[2] != 2 * p) {
            paired[p] = 2 * p;
            paired[paired[2]] = paired[2 * p];
            paired[paired[2 * p]] = paired[2];
            paired[2 * p] = p;
            paired[2] = 0;
          } else {
            paired[p] = 2 * p;
            paired[2 * p] = p;
            paired[2] = 0;
          }
        }
      }
    }
  }
  printf("%d\n", m);
  for (int i = 2; i <= n; i++)
    if (i < paired[i]) printf("%d %d\n", i, paired[i]);
  return 0;
}