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.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Random;
import java.util.StringTokenizer;

public class CF_JzzhuAndApples {

	static boolean[] np;
	static ArrayList<Integer> primes;

	static void sieve(int n) {
		np = new boolean[n];
		primes = new ArrayList<>();
		for (int i = 2; i < n; i++)
			if (!np[i]) {
				primes.add(i);
				for (long j = 1l * i * i; j < n; j += i)
					np[(int) j] = true;
			}

	}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Queue<Integer> pairs = new LinkedList<>();
		sieve(n / 2 + 1);
		LinkList ll = new LinkList();
		for (int i = n; i >= 2; i--)
			ll.add(i);
		for (int i = 1; i < primes.size(); i++) {
			int p = primes.get(i);
			Node curr = ll.root;
			Queue<Node> q = new LinkedList<>();
			while (curr != null && curr.value >= p) {
				if (curr.value % p == 0)
					q.add(curr);
				curr = curr.next;
			}
			boolean flag = q.size() % 2 == 0;
			while (!q.isEmpty()) {
				Node node = q.poll();
				if (!flag && node.value == 2 * p)
					continue;
				pairs.add(node.value);
				ll.remove(node);
			}
		}
		Node curr = ll.root;
		while (curr != null) {
			if (curr.value % 2 == 0)
				pairs.add(curr.value);
			curr = curr.next;
		}
		PrintWriter out = new PrintWriter(System.out);
		out.println(pairs.size() / 2);
		while (pairs.size() >= 2) {
			out.println(pairs.poll() + " " + pairs.poll());
		}
		out.close();
	}

	static class LinkList {
		Node root;
		Node last;

		public void add(int i) {
			Node n = new Node(i);
			if (root == null) {
				root = n;
				return;
			}
			if (last == null) {
				root.next = last = n;
				n.prev = root;
				return;
			}
			last.next = n;
			n.prev = last;
			last = n;

		}

		public void remove(Node n) {
			if (n == root) {
				n.next.prev = null;
				root = n.next;
				return;
			}
			if (n == last) {
				n.prev.next = null;
				last = n.prev;
				return;
			}
			n.prev.next = n.next;
			n.next.prev = n.prev;
		}
	}

	static class Node {
		int value;
		Node next;
		Node prev;

		public Node(int a) {
			value = a;
		}
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(String f) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(f));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

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

		public String nextLine() throws IOException {
			return br.readLine();
		}

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

		public boolean ready() throws IOException {
			return br.ready();
		}

		public int[] nextIntArray(int n) throws IOException {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public int[] nextIntArray1(int n) throws IOException {
			int[] a = new int[n + 1];
			for (int i = 1; i <= n; i++)
				a[i] = nextInt();
			return a;
		}

		public int[] shuffle(int[] a, int n) {
			int[] b = new int[n];
			for (int i = 0; i < n; i++)
				b[i] = a[i];
			Random r = new Random();
			for (int i = 0; i < n; i++) {
				int j = i + r.nextInt(n - i);
				int t = b[i];
				b[i] = b[j];
				b[j] = t;
			}
			return b;
		}

		public int[] nextIntArraySorted(int n) throws IOException {
			int[] a = nextIntArray(n);
			a = shuffle(a, n);
			Arrays.sort(a);
			return a;
		}

		public long[] nextLongArray(int n) throws IOException {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		public long[] nextLongArray1(int n) throws IOException {
			long[] a = new long[n + 1];
			for (int i = 1; i <= n; i++)
				a[i] = nextLong();
			return a;
		}

		public long[] nextLongArraySorted(int n) throws IOException {
			long[] a = nextLongArray(n);
			Random r = new Random();
			for (int i = 0; i < n; i++) {
				int j = i + r.nextInt(n - i);
				long t = a[i];
				a[i] = a[j];
				a[j] = t;
			}
			Arrays.sort(a);
			return a;
		}
	}

}