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.util.*;


public class JzzhuAndApples {
	public static void main (String[] args) {
		class Duple implements Comparable<Duple> {
			public int a;	
			public int b;
			
			public Duple(int a, int b) { 
				this.a = a;
				this.b = b;
			}
			// sort according to first entry
			public int compareTo(Duple other) {
				return this.a - other.a;
			}
			
			@Override
			public String toString() {
				return a + " " + b;
			}
		}
		
		Scanner input = new Scanner(System.in);
		
		int n = input.nextInt();
		
		boolean [] isPrime = new boolean[n+1];
		boolean [] used = new boolean[n+1];
		
		Arrays.fill(isPrime, 2, isPrime.length, true);
		
		// sieve
		for (int i = 2; i < isPrime.length; i++) {
			if (isPrime[i]) {
				for (int j = 2 * i; j < isPrime.length; j += i) {
					isPrime[j] = false;
				}
			}
		}
		
		List<Duple> pairs = new ArrayList<Duple>();
		
		for (int i = 3; i <= n / 2; i++) {
			if (isPrime[i]) {
				List<Integer> temp = new ArrayList<Integer>();
				
				for (int j = 1; j * i <= n; j++) {
					if (!used[j * i]) {
						temp.add(j * i);
					}
				}
				
				int numMuls = temp.size();
				
				if (numMuls % 2 == 0) {
					
					for (int k = 0; k < numMuls - 1; k += 2) {
						
						pairs.add(new Duple(temp.get(k), temp.get(k+1)));
						used[temp.get(k)] = true;
						used[temp.get(k+1)] = true;
						
					}
					
				} else if (numMuls > 1){
					
					pairs.add(new Duple(i, temp.get(2)));
					used[i] = true;
					used[temp.get(2)] = true;
					
					for (int k = 3; k < numMuls - 1; k += 2) {
						
						pairs.add(new Duple(temp.get(k), temp.get(k+1)));
						used[temp.get(k)] = true;
						used[temp.get(k+1)] = true;
						
					}
					
				}
			}			
		}

		List<Integer> temp = new ArrayList<Integer>();
		
		for (int j = 1; j * 2 <= n; j++) {
			if (!used[j * 2]) {
				temp.add(j * 2);
			}
		}
		
		int numMuls = temp.size();
		
		if (numMuls % 2 == 0) {
			
			for (int k = 0; k < numMuls - 1; k += 2) {
				
				pairs.add(new Duple(temp.get(k), temp.get(k+1)));
				used[temp.get(k)] = true;
				used[temp.get(k+1)] = true;
				
			}
			
		} else if (numMuls > 1){
			
			pairs.add(new Duple(2, temp.get(2)));
			used[2] = true;
			used[temp.get(2)] = true;
			
			for (int k = 3; k < numMuls - 1; k += 2) {
				
				pairs.add(new Duple(temp.get(k), temp.get(k+1)));
				used[temp.get(k)] = true;
				used[temp.get(k+1)] = true;
				
			}
			
		}
		
		System.out.println(pairs.size());
		for (Duple d : pairs) {
			System.out.println(d);
		}
		
		input.close();
		
	}
	
	
}