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.IOException;
import java.io.InputStreamReader;
import java.io.FileReader;
import java.util.Arrays;
import java.util.Vector;
import java.awt.Point;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Agostinho Junior (junior94)
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {
	OutputWriter out;
	InputReader in;
	public void solve(int testNumber, InputReader in, OutputWriter out) {
		this.in = in; this.out = out;
		int n = in.readInt();
		boolean[] matched = new boolean[n + 5];
		boolean[] isPrime = new boolean[n + 5];
		Arrays.fill(isPrime, true);
		isPrime[2] = true;
		for (int i = 2; i * i <= n; i++) if (isPrime[i]) {
			for (int j = i * 2; j <= n; j += i) {
				isPrime[j] = false;
			}
		}
		Vector<Point> ans = new Vector<Point>();
		Vector<Integer> remaining = new Vector<Integer>();
		for (int i = 3; i <= n / 2; i++) if (isPrime[i] && !matched[i]) {
			remaining.clear();
			for (int j = i; j <= n; j += i) if (!matched[j]) {
				remaining.add(j);
			}
			for (int j = 0; j + 1 < remaining.size(); j += 2) {
				int x = remaining.get(j);
				int y;
				if (j == 0 && remaining.size() % 2 == 1) {
					y = remaining.get(j + 2);
					j++;
				} else {
					y = remaining.get(j + 1);
				}
				matched[x] = true;
				matched[y] = true;
				ans.add(new Point(x, y));
			}
		}
		remaining.clear();
		for (int i = 2; i <= n; i += 2) {
			if (!matched[i]) {
				remaining.add(i);
			}
		}
		for (int i = 0; i + 1 < remaining.size(); i += 2) {
			ans.add(new Point(remaining.get(i), remaining.get(i + 1)));
		}
		out.println(ans.size());
		for (Point p: ans) {
			out.println(p.x + " " + p.y);
		}
	}
}

class OutputWriter {
	private PrintWriter output;
	public OutputWriter() {
		this(System.out);
	}
	public OutputWriter(OutputStream out) {
		output = new PrintWriter(out);
	}
	public OutputWriter(Writer writer) {
		output = new PrintWriter(writer);
	}

	public void println(Object o) {
		output.println(o);
	}

	public void close() {
		output.close();
	}
}

class InputReader {
	private BufferedReader input;
	private StringTokenizer line = new StringTokenizer("");
	public InputReader() {
		this(System.in);
	}
	public InputReader(InputStream in) {
		input = new BufferedReader(new InputStreamReader(in));
	}
	public InputReader(String s) {
		try {
			input = new BufferedReader(new FileReader(s));
		} catch(IOException io) { io.printStackTrace(); System.exit(0);}
	}
	public void fill() {
		try {
			if(!line.hasMoreTokens()) line = new StringTokenizer(input.readLine());
		} catch(IOException io) { io.printStackTrace(); System.exit(0);}
	}

	public int readInt() {
		fill();
		return Integer.parseInt(line.nextToken());
	}
}