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.awt.image.AreaAveragingScaleFilter;
import static java.lang.Math.*;
import java.lang.*;



public class Main {
    static FastScanner in;
    static PrintWriter out;
    public static void main(String[] args) throws FileNotFoundException {
        runIO(0);

        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }

    public static void runIO(int R) throws FileNotFoundException{
        if (R==1){
            in = new FastScanner(new File("input.txt"));
            out = new PrintWriter(new File("output.txt"));
        } else
        {
            in = new FastScanner(System.in);
            out = new PrintWriter(System.out);
        }
    }
}


class Task {
    final int N = 100100;
    final int Inf = 1000000007;
    int n, x;
    boolean u[] = new boolean[N];
    boolean u2[] = new boolean[N];
    Pair a[] = new Pair[N];
    int all;
    int adjacent_primes[] = new int[N];
    int match[] = new int[N];

    public void Method1(){
        all=0;
        for (int i=2; i<=n; i++) {
            if (u[i]==false) for (int j=i+i; j<=n; j+=i) u[j]=true;
        }
        for (int i=n/2; i>1; i--){
            if (u[i]==false){
                adjacent_primes[0]=0;
                for (int j=i; j<=n; j+=i){
                    if (match[j]==0) {
                        adjacent_primes[0]++;
                        adjacent_primes[adjacent_primes[0]] = j;
                    }
                }
                if (adjacent_primes[0] % 2==0)
                {
                    for (int j = 2; j <= adjacent_primes[0]; j += 2) {
                        int x = adjacent_primes[j-1];
                        int y = adjacent_primes[j];
                        match[x]=1;
                        match[y]=1;
                        all++;
                        a[all] = new Pair(x, y);
                    }
                } else
                if (adjacent_primes[0]>2)
                {
                    int x = adjacent_primes[1];
                    int y = adjacent_primes[3];
                    match[x] = match[y]=1;
                    a[++all] = new Pair(x, y);
                    for (int j=4; j+1<=adjacent_primes[0]; j+=2){
                        x = adjacent_primes[j];
                        y = adjacent_primes[j+1];
                        match[x]=1;
                        match[y]=1;
                        all++;
                        a[all] = new Pair(x, y);
                    }
                }
            }
        }
    }


    public void solve(int testNumber, FastScanner in, PrintWriter out) {
        n = in.nextInt();
        Method1();
        out.println(all);
        for (int i=1; i<=all; i++) out.println(a[i].first+" "+a[i].second);

    }

}

class Pair implements Comparable<Pair>{
    public int first, second;
    Pair(){
        first=second=-1;
    }
    Pair(int a, int b){
        first = a; second=b;
    }
    @Override
    public int compareTo(Pair b){
        if (first<b.first) return 1; else
        if (first>b.first) return -1; else
        if (second<b.second)  return 1; else return -1;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        char c = (char)42;
        result = (int)(1L*first*second + first + second);
        if (second!=0) result+=first % second;
        if (first!=0) result+=second%first;
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        Pair b = (Pair)obj;
        if (first==b.first && second==b.second) return true;
        return false;
    }

}

class PairComparator implements Comparator<Pair>{

    public int compare(Pair a, Pair b) {
        if (a.first<b.first) return 1; else
        if (a.first>b.first) return -1; else
        if (a.second<b.second)  return 1; else return -1;
    }
}


class FastScanner {
    BufferedReader br;
    StringTokenizer st;

    public FastScanner(File f) {
        try {
            br = new BufferedReader(new FileReader(f));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

    public FastScanner(InputStream f) {
        br = new BufferedReader(new InputStreamReader(f));
    }

    String next() {
        while (st == null || !st.hasMoreTokens()) {
            String s = null;
            try {
                s = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (s == null)
                return null;
            st = new StringTokenizer(s);
        }
        return st.nextToken();
    }

    boolean hasMoreTokens() {
        while (st == null || !st.hasMoreTokens()) {
            String s = null;
            try {
                s = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (s == null)
                return false;
            st = new StringTokenizer(s);
        }
        return true;
    }

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

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

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