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

#GL0000218. Thử thách đếm ước của tích ba số (Number Challenge)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Thử thách đếm ước của tích ba số (Number Challenge)

Thử thách đếm ước của tích ba số (Number Challenge)

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Let d(x)d(x) denote the number of positive divisors of xx. Given integers a,b,ca,b,c, calculate

$$\sum_{i=1}^{a}\sum_{j=1}^{b}\sum_{k=1}^{c}d(ijk)\pmod{2^{30}}.$$

The modulus is exactly 10737418241073741824.

Input

One line contains a,b,ca,b,c.

Output

Print one integer in [0,230−1][0,2^{30}-1].

Subtasks

  • Subtask 1 (20 points): 1≤a,b,c≤151\le a,b,c\le 15.

  • Subtask 2 (30 points): 1≤a,b,c≤2001\le a,b,c\le 200.

  • Subtask 3 (50 points): 1≤a,b,c≤20001\le a,b,c\le 2000.

Examples

Example 1

Input

2 2 2

Output

20

Explanation

The eight divisor counts sum to 20.

Example 2

Input

4 4 4

Output

328

Explanation

Summing all 64 divisor counts gives 328.

Example 3

Input

10 10 10

Output

11536

Explanation

Summing the 1000 divisor counts gives 11536.