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

#GL0000187. Bốn biến số (Four Variables)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Bốn biến số (Four Variables)

Four Variables

Source: AtCoder

Version: Phuoc Hung OJ Extended

Problem Statement

Given a positive integer NN, count ordered quadruples of positive integers (A,B,C,D)(A,B,C,D) satisfying

A⋅B+C⋅D=N.A\cdot B+C\cdot D=N.

Different positions matter: swapping AA and BB generally produces a different ordered quadruple. The answer is guaranteed not to exceed 9⋅10189\cdot10^{18}.

Input

The input contains NN.

Output

Print the number of valid ordered quadruples.

Subtasks

  • Subtask 1 (20 points): 2≤N≤1002 \le N \le 100.

  • Subtask 2 (30 points): 2≤N≤100002 \le N \le 10000.

  • Subtask 3 (50 points): 2≤N≤2000002 \le N \le 200000.

Examples

Example 1

Input

4

Output

8

Explanation

The eight ordered quadruples are (1,1,1,3)(1,1,1,3), (1,1,3,1)(1,1,3,1), (1,2,1,2)(1,2,1,2), (1,2,2,1)(1,2,2,1), (1,3,1,1)(1,3,1,1), (2,1,1,2)(2,1,1,2), (2,1,2,1)(2,1,2,1) and (3,1,1,1)(3,1,1,1).

Example 2

Input

292

Output

10886

Explanation

Summing the ordered factor-pair counts for xx and 292−x292-x gives 1088610886.

Example 3

Input

19876

Output

2219958

Explanation

For N=19876N=19876, the factor-pair counting sum evaluates to 22199582219958.