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.*;
import java.util.*;
import java.math.*;
import java.text.*;
public class Main{


@SuppressWarnings("unchecked")
public static void main(String[] args) throws IOException 
{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

int n,i,j,cnt,q_size,ans_size;



        int N1 = 100000+1;

        // initially assume all integers are prime
        boolean[] isPrime = new boolean[N1 + 1];
        for (i = 2; i <= N1; i++) {
            isPrime[i] = true;
        }

        // mark non-primes <= N using Sieve of Eratosthenes
        for (i = 2; i*i <= N1; i++) {

            // if i is prime, then mark multiples of i as nonprime
            // suffices to consider mutiples i, i+1, ..., N/i
            if (isPrime[i]) {
                for (j = i; i*j <= N1; j++) {
                    isPrime[i*j] = false;
                }
            }
        }





n=Integer.parseInt(in.readLine().trim());

int[] q=new int[n];
boolean[] is_2p=new boolean[n+1];
boolean[] found=new boolean[n+1];
int[][] ans=new int[n/2][2];
ans_size=0;


for(i=2;i<=n;i++)
{
    if(isPrime[i] && 2*i<=n)
        is_2p[2*i]=true;
}



cnt=0;

for(i=3;i<=n/2;i++)
{
    if(isPrime[i])
    {
        q_size=0;

        for(j=i*3;j<=n;j+=i)
        {
            if(!found[j])
                q[q_size++]=j;
        }

        if(q_size%2==1)
            q[q_size++]=i;


        for(j=0;j+1<q_size;j+=2)
        {
            found[q[j]]=true;
            found[q[j+1]]=true;
            ans[ans_size][0]=q[j];
            ans[ans_size++][1]=q[j+1];
            cnt++;
        }
    }
}



        q_size=0;
        i=2;

        for(j=i*3;j<=n;j+=i)
        {
            if(!is_2p[j] && !found[j])
                q[q_size++]=j;
        }

        if(q_size%2==1)
            q[q_size++]=i;


        for(j=0;j+1<q_size;j+=2)
        {
            found[q[j]]=true;
            found[q[j+1]]=true;
            ans[ans_size][0]=q[j];
            ans[ans_size++][1]=q[j+1];
            cnt++;
        }








for(i=2;i<=n/2;i++)
{
    if(isPrime[i] && !found[i])
    {
        is_2p[2*i]=false;
        cnt++;

        ans[ans_size][0]=i;
        ans[ans_size++][1]=2*i;
    }
}





q_size=0;

for(i=2;i<=n;i++)
{
    if(is_2p[i])
    {
        q[q_size++]=i;
    }
}



for(i=0;i+1<q_size;i+=2)
{
    cnt++;
    ans[ans_size][0]=q[i];
    ans[ans_size++][1]=q[i+1];
}



System.out.println(cnt);


for(i=0;i<ans_size;i++)
    System.out.println(ans[i][0]+" "+ans[i][1]);


out.flush();
out.close();
}
}