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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.StringTokenizer;

/**
 * @author Don Li
 */
public class JzzhuApples {
    void solve() {
        int n = in.nextInt();
        
        int[] primes = getPrimes(n / 2 + 5);
        int m = primes.length;
        
        List<Integer> res = new ArrayList<>();
        List<Integer> list = new ArrayList<>();
        boolean[] used = new boolean[n + 1];
        for (int i = 1; i < m; i++) {
            int p = primes[i];
            if (p > n / 2) break;
            list.clear();
            int cur = p;
            while (cur <= n) {
                if (!used[cur]) {
                    list.add(cur);
                    used[cur] = true;
                }
                cur += p;
            }
            if (list.size() % 2 == 1) {
                res.add(list.get(0));
                used[list.get(1)] = false;
                for (int j = 2; j < list.size(); j++) res.add(list.get(j));
            } else {
                res.addAll(list);
            }
        }
        
        for (int i = 2; i <= n; i += 2) {
            if (!used[i]) res.add(i);
        }
        
        out.println(res.size() / 2);
        int p = 0;
        for (int i = 0; i < res.size() / 2; i++) {
            out.printf("%d %d%n", res.get(p), res.get(p + 1));
            p += 2;
        }
    }
    
    int[] getPrimes(int n) {
        boolean[] prime = new boolean[n];
        Arrays.fill(prime, true);
        prime[0] = prime[1] = false;
        int sqrt = (int) (Math.sqrt(n) + 0.5);
        for (int i = 2; i <= sqrt; i++) {
            if (prime[i]) {
                for (int j = i * i; j < n; j += i) {
                    prime[j] = false;
                }
            }
        }
        int cnt = 0;
        for (int i = 0; i < n; i++) if (prime[i]) cnt++;
        int[] res = new int[cnt];
        cnt = 0;
        for (int i = 0; i < n; i++) if (prime[i]) res[cnt++] = i;
        return res;
    }
    
    public static void main(String[] args) {
        in = new FastScanner(new BufferedReader(new InputStreamReader(System.in)));
        out = new PrintWriter(System.out);
        new JzzhuApples().solve();
        out.close();
    }
    
    static FastScanner in;
    static PrintWriter out;
    
    static class FastScanner {
        BufferedReader in;
        StringTokenizer st;
        
        public FastScanner(BufferedReader in) {
            this.in = in;
        }
        
        public String nextToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        
        public int nextInt() {
            return Integer.parseInt(nextToken());
        }
        
        public long nextLong() {
            return Long.parseLong(nextToken());
        }
        
        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }
}