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 JAVA):

Solution:
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import static java.lang.Math.*;
import static java.util.Arrays.*;

public class Main {

	public static void main(String[] args) throws IOException {
		new Main().run();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");

	private void run() throws IOException {
		if (new File("input.txt").exists())
			in = new BufferedReader(new FileReader("input.txt"));
		else
			in = new BufferedReader(new InputStreamReader(System.in));
		if (new File("output.txt").exists())
			out = new PrintWriter("output.txt");
		else
			out = new PrintWriter(System.out);

		solve();

		in.close();
		out.close();
	}

	final int maxn = 100 * 1000 + 10;

	int n;

	int countPrimes;
	int primes[] = new int[maxn];
	int minDiv[] = new int[maxn];
	int maxDiv[] = new int[maxn];

	int first[] = new int[maxn];
	int second[] = new int[maxn];

	int countAns;
	int ans0[] = new int[maxn];
	int ans1[] = new int[maxn];

	void precalc() {
		countPrimes = 0;
		for (int i = 2; i < maxn; i++)
			minDiv[i] = i;
		for (int i = 2; i < maxn; i++) {
			if (minDiv[i] == i)
				primes[countPrimes++] = i;
			for (int j = 0; j < countPrimes && primes[j] <= minDiv[i] && primes[j] * i < maxn; j++)
				minDiv[primes[j] * i] = primes[j];
		}
		for (int i = 2; i < maxn; i++)
			if (minDiv[i] == i)
				maxDiv[i] = i;
			else
				maxDiv[i] = maxDiv[i / minDiv[i]];

	}

	void solve() throws IOException {
		precalc();
		n = nextInt();

		fill(first, -1);
		fill(second, -1);
		countAns = 0;
		for (int i = 2; i <= n; i++) {
			int d = maxDiv[i];
			if (2 * d == i)
				second[d] = i;
			else {
				if (first[d] == -1)
					first[d] = i;
				else {
					ans0[countAns] = first[d];
					ans1[countAns++] = i;
					first[d] = -1;
				}
			}
		}
		int free = -1;
		for (int i = 2; i <= n; i++) {
			if (first[i] != -1 && second[i] != -1) {
				ans0[countAns] = first[i];
				ans1[countAns++] = second[i];
			}
			if (first[i] == -1 && second[i] != -1) {
				if (free == -1)
					free = second[i];
				else {
					ans0[countAns] = free;
					ans1[countAns++] = second[i];
					free = -1;
				}
			}
		}

		out.println(countAns);
		for (int i = 0; i < countAns; i++)
			out.println(ans0[i] + " " + ans1[i]);
	}

	String nextLine() throws IOException {
		st = new StringTokenizer("");
		return in.readLine();
	}

	String nextToken() throws IOException {
		while (!st.hasMoreTokens()) {
			st = new StringTokenizer(in.readLine());
		}
		return st.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	boolean EOF() throws IOException {
		while (!st.hasMoreTokens()) {
			String str = in.readLine();
			if (str == null)
				return true;
			st = new StringTokenizer(str);
		}
		return false;
	}

}