#P2568. GCD

GCD

Description

Given a positive integer nn, count the number of pairs (x,y)(x, y) such that 1x,yn1\le x, y\le n and gcd(x,y)\gcd(x,y) is a prime number.

Input Format

A single line containing one integer representing nn.

Output Format

Output a single integer in one line, representing the answer.

4
4

Hint

Sample Input/Output 1 Explanation

For the sample, the pairs (x,y)(x, y) that satisfy the condition are (2,2)(2, 2), (2,4)(2, 4), (3,3)(3, 3), (4,2)(4, 2).


Constraints

  • For 100%100\% of the testdata, it is guaranteed that 1n1071\le n\le 10^7.

Source: bzoj2818.

The testdata for this problem are self-made by Luogu, generated using CYaRon, taking 5 minutes.

Translated by ChatGPT 5