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.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.flush();
		out.close();
	}
}

class Pair implements Comparable<Pair> {
	int first;
	int second;

	Pair(int first, int second) {
		this.first = first;
		this.second = second;
	}

	@Override
	public int compareTo(Pair e) {
		return Long.compare(second, e.second);

	}
}

class TaskB {
	int INF = (int) 1e9 + 7;
	int MAX_N = (int) 1e5 + 5;
	long mod = (long) 1e8;
	ArrayList<Pair> edges[];
	boolean processed[];
	ArrayList<Integer> topSort;
	long distTo[];
	ArrayList<Pair> trains;
	int used[];

	void solve(int testNumber, InputReader in, PrintWriter pw) {
		int n = in.nextInt();
		boolean sieve[] = new boolean[(int) 1e5 + 5];
		Arrays.fill(sieve, true);
		sieve[0] = false;
		sieve[1] = false;
		for (int i = 2; i <= Math.sqrt(sieve.length); i++) {
			if (sieve[i]) {
				for (int j = i * i; j < sieve.length; j += i) {
					sieve[j] = false;
				}
			}
		}
		ArrayList<Pair> ans = new ArrayList<>();
		boolean vis[] = new boolean[n + 1];
		for (int i = 3; i <= n / 2; i++) {
			if (sieve[i]) {
				int cnt = 0;
				for (int j = i; j <= n; j += i) {
					if (!vis[j]) {
						cnt++;
					}
				}
				int p = 0;
				int temp = i;
				if (cnt % 2 != 0) {
					for (int j = i; j <= n; j += i) {
						if (!vis[j]) {
							if (j != 2 * i) {
								if (p % 2 != 0) {
									ans.add(new Pair(temp, j));
									vis[temp] = true;
									vis[j] = true;
								}
								p++;
								temp = j;
							}
						}
					}
				} else {
					for (int j = i; j <= n; j += i) {
						if (!vis[j]) {
							if (p % 2 != 0) {
								ans.add(new Pair(temp, j));
								vis[temp] = true;
								vis[j] = true;
							}
							p++;
							temp = j;
						}
					}
				}
			}
		}
		int p = 0;
		int temp = 2;
		for (int i = 2; i <= n; i += 2) {
			if (!vis[i]) {
				if (p % 2 != 0) {
					ans.add(new Pair(temp, i));
					vis[temp] = true;
					vis[i] = true;
				}
				p++;
				temp = i;
			}
		}
		pw.println(ans.size());
//		pw.println(ans.get(41).first + " " + ans.get(41).second);
		for (Pair pair : ans) {
			pw.println(pair.first + " " + pair.second);
		}
	}

	long gcd(long a, long b) {
		if (b == 0) {
			return a;
		} else {
			return gcd(b, a % b);
		}
	}

	int[] shrink(int a[]) {
		int n = a.length;
		long b[] = new long[n];
		for (int i = 0; i < n; i++) {
			b[i] = ((long) (a[i] << 32)) | i;
		}
		Arrays.sort(b);
		int ret[] = new int[n];
		int p = 0;
		for (int i = 0; i < n; i++) {
			if (i > 0 && (b[i] ^ b[i - 1]) >> 32 != 0) {
				p++;
			}
			ret[(int) b[i]] = p;
		}
		return ret;
	}

	int sum(int ft[], int i) {
		int sum = 0;
		for (int j = i; j >= 1; j -= (j & -j)) {
			sum += ft[j];
//			System.out.println(sum);
		}
		return sum;
	}

	void add(int ft[], int i, int x) {
		for (int j = i; j < ft.length; j += (j & -j)) {
//			System.out.println(j);
			ft[j] += x;
		}
	}

	boolean isValid(int i, int j, char arr[][]) {

		if (i >= arr[0].length || j >= arr[0].length) {
			return false;
		}
		if (arr[i][j] == '*') {
			return false;
		}
		return true;
	}

	long pow(long m, long k) {
		long prod = 1;
		for (int i = 0; i < k; i++) {
			prod = (prod * m) % INF;
		}
		return prod % INF;
	}

//	int sum(int k) {
//		int sum=0;
//		for(int i=k;i>=1;i) {
//			sum+=ft[k];
//		}
//	}

	long fib(int N) {
		long fib[] = new long[N + 1];
		fib[0] = 1;
		fib[1] = 1;
		for (int i = 2; i <= N; i++) {
			fib[i] = (fib[i - 1] + fib[i - 2]) % mod;
		}
		return fib[N] % mod;
	}

	long sum(int i, int j, long arr[]) {
		long sum = 0;
		for (int k = i; k <= j; k++) {
			sum += arr[k];
		}
		return sum;
	}

	int __gcd(int a, int b) {
		if (b == 0)
			return a;
		return __gcd(b, a % b);

	}

	public int getInt(int num) {
		int ret = -1;
		switch (num) {
		case 0:
			ret = 6;
			break;
		case 1:
			ret = 2;
			break;
		case 2:
			ret = 5;
			break;
		case 3:
			ret = 5;
			break;
		case 4:
			ret = 4;
			break;
		case 5:
			ret = 5;
			break;
		case 6:
			ret = 6;
			break;
		case 7:
			ret = 3;
			break;
		case 8:
			ret = 7;
			break;
		case 9:
			ret = 6;
			break;
		}
		return ret;
	}

	public int isPow(long num) {
		int count = 0;
		while (num > 0) {
			num /= 2;
			count++;
		}
		return count;
	}
}

class InputReader {
	BufferedReader br;
	StringTokenizer st;

	public InputReader(InputStream in) {
		br = new BufferedReader(new InputStreamReader(in));
		st = null;
	}

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

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

	public long nextLong() {
		return Long.parseLong(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}