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.math.BigInteger;
import java.util.*;

import static java.lang.Math.*;
import static java.math.BigInteger.valueOf;
import static java.util.Arrays.*;


public class Main{

    void run(){
        Locale.setDefault(Locale.US);
        boolean my;
        try {
            my = System.getProperty("MY_LOCAL") != null;
        } catch (Exception e) {
            my = false;
        }
        try{
            err = System.err;
            if( my ){
                sc  = new FastScanner(new BufferedReader(new FileReader("input.txt")));
//                sc  = new FastScanner(new BufferedReader(new FileReader("C:\\myTest.txt")));
                out = new PrintWriter   (new FileWriter("output.txt"));
            }
            else {
                sc  = new FastScanner( new BufferedReader(new InputStreamReader(System.in)) );
                out = new PrintWriter( new OutputStreamWriter(System.out));
            }
//            out = new PrintWriter(new OutputStreamWriter(System.out));
        }catch(Exception e){
            MLE();
        }
        if( my )
            tBeg = System.currentTimeMillis();
        solve();
//        check();
        if( my ){
            err.println( "TIME: " + (System.currentTimeMillis() - tBeg ) / 1e3 );
            err.println( "MEM : " + memoryStatus() );
        }
        exit(0);
    }

    static String memoryStatus() {
        return (Runtime.getRuntime().totalMemory()
                - Runtime.getRuntime().freeMemory() >> 20)
                + "/" + (Runtime.getRuntime().totalMemory() >> 20) + " MB";
    }

    void exit( int val ){
        err.flush();
        out.flush();
        System.exit(val);
    }

    double tBeg;
    FastScanner sc;
    PrintWriter out;
    PrintStream err;

    class FastScanner{

        StringTokenizer st;
        BufferedReader br;

        FastScanner( BufferedReader _br ){
            br = _br;
        }

        String readLine(){
            try {
                return br.readLine();
            } catch (IOException e) {
                return null;
            }
        }

        String next(){
            while( st==null || !st.hasMoreElements() )
                st = new StringTokenizer(readLine());
            return st.nextToken();
        }

        int nextInt(){ return Integer.parseInt(next()); }
        long nextLong(){ return Long.parseLong(next()); }
        double nextDouble(){ return Double.parseDouble(next()); }
    }

    static void MLE(){
        int[][] arr = new int[1024*1024][]; for( int i = 0; i < 1024*1024; ++i ) arr[i] = new int[1024*1024];
    }

    void MLE( boolean doNotMLE ){ if( !doNotMLE ) MLE(); }

    void TLE(){
        for(;;);
    }

    public static void main(String[] args) {
        new Main().run();
//        new Thread( null, new Runnable() {
//            @Override
//            public void run() {
//                new Main().run();
//            }
//        }, "Lolka", 256_000_000L ).run();
    }

    ////////////////////////////////////////////////////////////////



    void solve(){
        int n;
        int[] pair;
        boolean[] isPrime;
        ArrayList<String> ans;

        n = sc.nextInt();

        isPrime = new boolean[n+1];
        fill( isPrime, true );
        for (int i = 2; i <= n; i++) {
            if( isPrime[i] )
                for ( int j = 2*i; j <= n; j+=i ) {
                    isPrime[j] = false;
                }
        }

        pair = new int[n+1];
        fill( pair, -1 );
        for (int p = n; 3 <= p; p--) {
            if(!( 2*p <= n )) continue;
            //if(!valueOf(p).isProbablePrime(23)) continue;

            if(!isPrime[p]) continue;
            ArrayList<Integer> arr = new ArrayList<>();
            for (int k = 1; p*k <= n; k++) {
                if( pair[p*k] == -1 )
                    arr.add( p*k );
            }
            if( arr.size() == 0 ) MLE();
            if( arr.size() == 1 ){
                if( arr.get(0) != p ) MLE();

                pair[p] = pair[pair[2*p]] = p;
                pair[2*p] = -1;
            }
            if( arr.size() % 2 == 1 ){
                if( !arr.remove((Integer)(2*p) )) MLE();
            }
            if( arr.size() % 2 == 1 ) MLE();
            {
                for (int i = 0; i < arr.size(); i+=2) {
                    int a = arr.get(i);
                    int b = arr.get(i+1);
                    pair[a] = b;
                    pair[b] = a;
                }
            }
        }

        ans = new ArrayList<>();
        for (int a = 2; a <= n; a++) {
            int b = pair[a];
            if( b == -1 ) continue;
            if( pair[b] != a )
                MLE();
            if( a == b ) MLE();
            if( a < b )
                ans.add( a +" "+ b );
        }

        {
            int pred = -1;
            for( int a = 2; a <= n; a += 2 ) {
                if( pair[a] == -1 ){
                    if( pred == -1 )
                        pred = a;
                    else{
                        ans.add( pred +" "+ a );
                        pred = -1;
                    }
                }
            }
        }

        out.println(ans.size());
        for (String s : ans) {
            out.println(s);
        }
    }

}