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.awt.Point;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.StringTokenizer;

public class C {
	public static void main(String[] args) {
		MyScanner in = new MyScanner();
		PrintWriter out = new PrintWriter(System.out);
		int n = in.nextInt();
		int[] primeSieve = primeSieve(n);
		boolean[] used = new boolean[n + 1];
		ArrayList<Point> ans = new ArrayList<>();
		for (int i = 3; 2 * i <= n; i++) {
			if (primeSieve[i] != i)
				continue;
			ArrayList<Integer> ps = new ArrayList<>();
			for (int j = i; j <= n; j += i) {
				if (used[j] || j == 2*i)
					continue;
				ps.add(j);
			}
			if(ps.size() % 2 == 1)
				ps.add(2*i);
			for (int k = 0; k + 1 < ps.size(); k += 2) {
				int p1 = ps.get(k), p2 = ps.get(k + 1);
				ans.add(new Point(p1, p2));
				used[p1] = true;
				used[p2] = true;
			}
		}
		ArrayList<Integer> ps = new ArrayList<>();
		for(int j=2;j<=n;j+=2) {
			if (used[j])
				continue;
			ps.add(j);
		}
		for (int k = 0; k + 1 < ps.size(); k += 2) {
			int p1 = ps.get(k), p2 = ps.get(k + 1);
			ans.add(new Point(p1, p2));
			used[p1] = true;
			used[p2] = true;
		}
		out.println(ans.size());
		for (Point p : ans) {
			out.println(p.x + " " + p.y);
		}
		out.close();
	}

	static int[] primeSieve(int N) {
		int[] lp = new int[N + 1];
		int[] pr = new int[N + 1]; // could shrink this to the number of primes
		int prSize = 0;
		for (int i = 2; i <= N; ++i) {
			if (lp[i] == 0) {
				lp[i] = i;
				pr[prSize++] = i;
			}
			int ub = Math.min(lp[i], N / i);
			for (int j = 0; j < prSize && pr[j] <= ub; ++j) {
				lp[i * pr[j]] = pr[j];
			}
		}
		return lp;
	}

	private static class MyScanner {
		BufferedReader br;
		StringTokenizer st;

		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}
	}
}