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 static java.lang.Math.*;
import static java.lang.System.currentTimeMillis;
import static java.lang.System.exit;
import static java.lang.System.arraycopy;
import static java.util.Arrays.sort;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.fill;
import java.util.*;
import java.io.*;

public class Main {

    public static void main(String[] args) throws IOException {
        try {
            if (new File("input.txt").exists())
                System.setIn(new FileInputStream("input.txt"));
        } catch (SecurityException e) {
        }
        new Main().run();
    }

    BufferedReader in;
    PrintWriter out;
    StringTokenizer st = new StringTokenizer("");

    private void run() throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        in.close();
        out.close();
    }

    int MAXN = 1000 * 100 + 100;
    int n;
    int[] ans1 = new int[MAXN];
    int[] ans2 = new int[MAXN];
    int[] buf = new int[MAXN];
    int[] even = new int[MAXN];
    int cntAns, cntEven;
    
    void modifyEratosfent() {
        boolean[] prime = new boolean[MAXN];
        boolean[] used = new boolean[MAXN];
        fill(prime, true);
        cntEven = cntAns = 0;
        even[cntEven++] = 2; used[2] = true;
        for(int i = 3; i <= n; i++) {
            if(prime[i]) {
                int cntBuf = 0;
                buf[cntBuf++] = i;
                for(int j = i * 2; j <= n; j += i){
                    if(!used[j])
                        buf[cntBuf++] = j;
                    prime[j] = false;
                }
                if(cntBuf % 2 == 0) {
                    for(int j = 0; j < cntBuf; j += 2) {
                        ans1[cntAns] = buf[j];
                        ans2[cntAns] = buf[j+1];
                        cntAns++;
                        used[buf[j]] = used[buf[j+1]] = true;
                    }
                } else if(cntBuf > 1) {
                    even[cntEven++] = buf[1];
                    ans1[cntAns] = buf[0];
                    ans2[cntAns] = buf[2];
                    cntAns++;
                    used[buf[0]] = used[buf[1]] = used[buf[2]] = true;
                    for(int j = 3; j < cntBuf; j += 2){
                        ans1[cntAns] = buf[j];
                        ans2[cntAns] = buf[j+1];
                        cntAns++;
                        used[buf[j]] = used[buf[j+1]] = true;
                    }
                }
            }
        }
        for(int i = 2; i <= n; i+=2)
            if(!used[i])
                even[cntEven++] = i;
        for(int i = 0; i < cntEven; i+=2) {
            if(i+1 < cntEven) {
                ans1[cntAns] = even[i];
                ans2[cntAns] = even[i+1];
                cntAns++;
            }
        }
    }
    
    private void solve() throws IOException {
        n = nextInt();
        modifyEratosfent();
        out.println(cntAns);
        for(int i = 0; i < cntAns; i++)
            out.println(ans1[i] + " " + ans2[i]);
    }
    
    String nextToken() throws IOException {
        while (!st.hasMoreTokens())
            st = new StringTokenizer(in.readLine());
        return st.nextToken();
    }
    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
    String nextLine() throws IOException {
        st = new StringTokenizer("");
        return in.readLine();
    }
    boolean EOF() throws IOException {
        while (!st.hasMoreTokens()) {
            String s = in.readLine();
            if (s == null)
                return true;
            st = new StringTokenizer(s);
        }
        return false;
    }
}