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

#SP0000086. Trò chơi người lính và các phép chia (Soldier and Number Game)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Trò chơi người lính và các phép chia (Soldier and Number Game)

Soldier and Number Game

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Given integers a,ba,b with a≥ba\ge b, consider n=a!/b!n=a!/b!, where x!=1⋅2⋯xx!=1\cdot2\cdots x. In each round, choose an integer divisor x>1x>1 of the current nn and replace nn by n/xn/x. The game ends when n=1n=1. Find the maximum possible number of rounds. Only the maximum count is required, not the sequence of moves.

Input

One line contains integers a,ba,b, in that order.

Output

Print one integer: the maximum possible number of rounds.

Subtasks

  • Subtask 1 (20 points): 1≤b≤a≤10001\le b\le a\le 1000.
  • Subtask 2 (30 points): 1≤b≤a≤1000001\le b\le a\le 100000.
  • Subtask 3 (50 points): 1≤b≤a≤50000001\le b\le a\le 5000000.

Examples

Input

6 3

Output

5

Explanation

Here n=6!/3!=4⋅5⋅6=120=23⋅3⋅5n=6!/3!=4\cdot5\cdot6=120=2^3\cdot3\cdot5. Divide successively by 2,2,2,3,52,2,2,3,5 to obtain 60,30,15,5,160,30,15,5,1, a total of five rounds. Every round must remove at least one prime factor, so more than five rounds are impossible. Print 5.