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.util.concurrent.BrokenBarrierException;

import javax.swing.text.html.MinimalHTMLWriter;

import static java.lang.Math.abs;
import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.Math.sqrt;

public class Main {


    public static void main(String [] args){
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Integer readFromFile=new Integer(1);
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }
    static class TaskD {
        void madAdd(Map <Integer, Integer> map, int value){
            if(map.containsKey(value)){
                map.put(value, map.get(value)+1);
            }else{
                map.put(value, 1);
            }
        }
        //I have to try at least two ways to solve this problem, I'll make one of them with ;
        class Pair implements Comparable<Pair>{
            int fist;
            int second;
            Pair(int fist, int second){
                this.fist = fist;
                this.second = second;
            }
            @Override
            public int compareTo(Pair arg0) {
                return fist-arg0.fist;
            }
        }
        int _gdc(int a, int b){
            if(a%b==0){
                return b;
            }else{
                return gdc(b, a%b);
            }
        }
        int gdc(int a, int b){
            if(a>=b){
                return _gdc(a, b);
            }else{
                return _gdc(b, a);
            }
        }



        boolean isPassedF(int []array, int c){
            boolean isPassed = false;
            long sum=0;
            for(int i=0, sum1=c; i<array.length-1; i++){
                if(sum1+array[i]-array[i+1]<0){
                    isPassed=true;
                    break;
                }else{
                    sum1+=array[i]-array[i+1];
                }
            }
            return isPassed;
        }
        int pow(int a, int n){
            int result = 1;
            for(int i=0; i<n; i++){
                result*=a;
            }
            return result;
        }




        void eratos(byte []primeNum){
            int size = primeNum.length;
            for(int i=2; i*i<size; i++){
                if(primeNum[i]==0){
                    for(int j=i+i; j<size; j+=i){
                        primeNum[j]=1;
                    }
                }
            }
        }
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int []arr = new int[n+1];
            final int maxValue =100005;
            byte []prime = new byte[maxValue];
            eratos(prime);
            for(int i=2; i<=n/2; i++){
                if(prime[i]==0){
                    for(int j=i; j<=n; j+=i){
                        arr[j]=i;
                    }
                }
            }
            int countTwo = 0;
            for(int i=2; i<=n/2; i++){
                if(prime[i]==0){
                    int countPrime = 0;
                    for(int j=i; j<=n; j+=i){
                        if(arr[j]==i){
                            countPrime++;
                        }
                    }
                    if((countPrime)%2!=0){
                        arr[i*2]=1;
                    }
                }
            }
            /*
            for(int i=0; i<=n; i++){
                if(arr[i]==3){
                    countTwo++;
                }
                System.out.println(arr[i]);
            }
            System.out.println(countTwo);
            */
            int dp[] = new int[n+1];
            List<Pair> lPair = new ArrayList<>(2000);
            int dp5[] = new int[n+1];
            for(int i=2; i<=n; i++){
                if(arr[i]==0){
                    continue;
                }
                if(dp[arr[i]]==0){
                    if(arr[i]==1){
                        dp[1]=i;
                       // dp5[dp[i]]++;
                    }else{
                        dp[arr[i]]=i;

                    }
                }else{
                   // System.out.println(gdc(dp[arr[i]], i));
                    /*
                    if(gdc(dp[arr[i]], i)==1){
                        System.out.print(arr[i]+" "+ i+" &");
                        System.out.println(dp[arr[i]]+" "+ i);
                    }
                    */
                    lPair.add(new Pair(dp[arr[i]], i));

                    dp5[dp[arr[i]]]++;
                    dp5[i]++;
                    //System.out.println( dp5[dp[arr[i]]]+" "+ dp5[dp[i]]);
                    dp[arr[i]]=0;

                }
            }
            out.println(lPair.size());
            for(int i=0; i<lPair.size(); i++){
                out.println(lPair.get(i).fist+" "+lPair.get(i).second);
            }

            //2 ways and sort
    		/*
    		int n = in.nextInt();
    		int m = in.nextInt();
    		//int []arr = new int[n];
    		List<Pair> listArr = new ArrayList<>(n);
    		final int maxValue = 1000001;
    		int []dp = new int[maxValue];
    		int []dp1 = new int[maxValue];
    		for(int i=0; i<n; i++){
    			int value = in.nextInt();
    			listArr.add(new Pair(value, i+1));
    			if(value<=maxValue){
    				dp[value]++;
    			}
    		}
    		Collections.sort(listArr);
    		byte []isVisited = new byte[maxValue];
    		for(int i=0; i<listArr.size(); i++){
    			if(listArr.get(i).fist>1000){
    				break;
    			}
    			if(isVisited[listArr.get(i).fist]==1){
    				continue;
    			}
    			for(int j=listArr.get(i).fist; j<30; j+=listArr.get(i).fist){
    				dp1[j]+=dp[listArr.get(i).fist];
    			}

    			isVisited[listArr.get(i).fist]=1;
    		}

    		int answer = 0;
    		int answerValue = 0;
    		for(int i=n; i>=0; i--){
    			if(answer<dp1[i]){
    				answer = dp1[i];
    				answerValue = i;
    			}
    		}
    		out.println(answerValue+" "+answer);
    		for(int i=0; i<n; i++){
    			if(answerValue%listArr.get(i).fist==0){
    				out.print(listArr.get(i).second+" ");
    			}
    		}
        }*/
        }
    }

    static class InputReader {
        BufferedReader br;
        StringTokenizer st;
        String st1;
        File file = new File("D:\\text.txt");
        public InputReader(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
            st = null;
        }
        public InputReader(int i) {
            try {
                br  = new BufferedReader(
                        new InputStreamReader(new FileInputStream(file)));
            } catch (FileNotFoundException e1) {
                System.out.println("File is not find");
            }
            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 String nextLine(){
            try {
                st1 = new String(br.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return st1;
        }
        public int nextInt()  {return Integer.parseInt(next());}
        public long nextLong(){
            return Long.parseLong(next());
        }
        public Double nextDouble(){
            return Double.parseDouble(next());
        }
        public Byte nextByte() {
            return Byte.parseByte(next());
        }
        private int idx;
        public Character nextChar() {
            if(st1==null) {
                st1 = next();
                idx = 0;
            }
            if(idx!=(st1.length())-1){
                return st1.charAt(idx++);
            }else{
                char  c= st1.charAt(idx);
                st1 = null;
                return c;
            }
        }
        public void newFile() {
            try {
                FileWriter write = new FileWriter(file);
                write.write("something for cheaking");
                write.close();

            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        public void writeFile1(){
            try{
                FileWriter write = new FileWriter(file);
                write.append("100000"+" ");
                for(int i=0; i<100000; i++){
                    write.append(new Integer((int)(Math.random()*5000)).toString()+" ");
                }
                write.close();

            }catch(IOException e){
                e.printStackTrace();
            }
        }
    }
}