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

#BS0000141. Đếm số hạng của dãy N + NOD(N) (N + NOD (N))

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Đếm số hạng của dãy N + NOD(N) (N + NOD (N))

N + NOD (N)

Source: UVa

Version: Phuoc Hung OJ Extended

Problem Statement

Consider the increasing sequence N0=1N_0=1 and Ni=Ni−1+NOD⁡(Ni−1)N_i=N_{i-1}+\operatorname{NOD}(N_{i-1}) for i≥1i\ge1, where NOD⁡(x)\operatorname{NOD}(x) counts all positive divisors of xx. Its initial terms are 1,2,4,7,9,12,18,…1,2,4,7,9,12,18,\ldots. Given A≤BA\le B, count the sequence terms in the inclusive range [A,B][A,B].

Input

One line contains integers A,BA,B.

Output

Print one line Case 1: k, where k is the count in [A,B][A,B].

Subtasks

  • Subtask 1 (20 points): 1≤A≤B≤100001\le A\le B\le 10000.
  • Subtask 2 (30 points): 1≤A≤B≤1000001\le A\le B\le 100000.
  • Subtask 3 (50 points): 1≤A≤B≤10000001\le A\le B\le 1000000.

Examples

Input

1 18

Output

Case 1: 7

Explanation

The first terms are 1,2,4,7,9,12,181,2,4,7,9,12,18. The divisor counts used to advance are respectively 1,2,3,2,3,61,2,3,2,3,6. Thus there are seven terms from 11 through 1818, inclusive, and the output is Case 1: 7.