problem

One day, Sosusa, who loves prime numbers, was playing with the pair $ (p, q) $, where $ p + q $ is a prime number. Suddenly, Sosusa wondered how many of these pairs were prime numbers with $ p $ and $ q $ both less than or equal to $ N $. Find the number on your behalf.



output

Output the number of pairs. Also, output a line break at the end.

Example

Input

3


Output

2
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final int MAX = 10000002;

        boolean[] isPrime = new boolean[MAX + 1];
        Arrays.fill(isPrime, true);
        isPrime[0] = isPrime[1] = false;

        for (int i = 2; i <= MAX; i++) {
            if ( !isPrime[i] ) {
                continue;
            }
            for (int j = i + i; j <= MAX; j += i) {
                isPrime[j] = false;
            }
        }

        while (sc.hasNextInt()) {
            int N = sc.nextInt();
            int ans = 0;

            for (int p = 3; p <= N; p++) {
                if ( !isPrime[p] ) {
                    continue;
                }

                if ( isPrime[p + 2] ) {
                    ans += 2;
                }
            }

            System.out.println(ans);
        }
    }
}

