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:
//package codeforces;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class C {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter writer = new PrintWriter(System.out);
    StringTokenizer stringTokenizer;

    String next() throws IOException {
        while (stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
            stringTokenizer = new StringTokenizer(reader.readLine());
        }
        return stringTokenizer.nextToken();
    }

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

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

    void solve() throws IOException {
        int n = nextInt();
        boolean[] isPrime = new boolean[n + 1];
        int[] smallestPrimeDivisor = new int[n + 1];
        Arrays.fill(smallestPrimeDivisor, Integer.MAX_VALUE);
        Arrays.fill(isPrime, true);
        for(int i = 2; i <= n; i++) {
            smallestPrimeDivisor[i] = Math.min(smallestPrimeDivisor[i], i);
            for(long j = 1l * i * i; j <= n; j += i) {
                final int ji = (int) j;
                isPrime[ji] = false;
                smallestPrimeDivisor[ji] = Math.min(smallestPrimeDivisor[ji], i);
            }
        }
        class Pair {
            int a, b;

            Pair(int a, int b) {
                this.a = a;
                this.b = b;
            }
        }
        List<Pair> answer = new ArrayList<>();
        boolean[] used = new boolean[n + 1];
        class RankedNumber implements Comparable<RankedNumber> {
            int number;
            int smallestPrimeDivisor;

            RankedNumber(int number, int smallestPrimeDivisor) {
                this.number = number;
                this.smallestPrimeDivisor = smallestPrimeDivisor;
            }

            @Override
            public int compareTo(RankedNumber o) {
                return -Integer.compare(smallestPrimeDivisor, o.smallestPrimeDivisor);
            }
        }
        RankedNumber[] rn = new RankedNumber[n + 1];
        for(int i = 2; i <= n; i++) {
            rn[i] = new RankedNumber(i, smallestPrimeDivisor[i]);
        }
        PriorityQueue<RankedNumber> pq = new PriorityQueue<>();
        for(int i = n; i > 1; i--) {
            if(isPrime[i]) {
                pq.clear();
                for(int j = i; j <= n; j += i) {
                    if(!used[j]) {
                        pq.add(rn[j]);
                    }
                }
                while(pq.size() >= 2) {
                    int a = pq.poll().number;
                    int b = pq.poll().number;
                    used[a] = true;
                    used[b] = true;
                    answer.add(new Pair(a, b));
                }
            }
        }
        writer.println(answer.size());
        for (Pair pair : answer) {
            writer.println(String.format("%d %d", pair.a, pair.b));
        }
        writer.close();
    }

    public static void main(String[] args) throws IOException {
        new C().solve();
    }
}