PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000087. Đếm cặp có BCNN bằng n (Pairs Forming LCM)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Đếm cặp có BCNN bằng n (Pairs Forming LCM)

Pairs Forming LCM

Source: LightOJ

Version: Phuoc Hung OJ Extended

Problem Statement

Given a positive integer nn, consider pairs (i,j)(i,j) with 1≤i≤j≤n1\le i\le j\le n. Count those for which lcm⁡(i,j)=n\operatorname{lcm}(i,j)=n. The restriction i≤ji\le j ensures that each unordered pair is counted exactly once.

Input

One line containing nn.

Output

Print the number of valid pairs.

Subtasks

  • Subtask 1 (20 points): 1≤n≤1041\le n\le 10^4
  • Subtask 2 (30 points): 1≤n≤1091\le n\le 10^9
  • Subtask 3 (50 points): 1≤n≤10141\le n\le 10^{14}

Examples

Input

12

Output

8

Explanation

The eight valid pairs are $(1,12),(2,12),(3,4),(3,12),(4,6),(4,12),(6,12),(12,12)$. All have LCM 1212 and satisfy i≤ji\le j.