Number of Representable Numbers#4572

Number of Representable Numbers

1 second
256 megabytes
Medium

Given two non-negative integers and .

A number is called representable if it can be written as a sum x = x_1 + x_2 + \ldots + x_n for some finite (possibly zero) number of terms, where each term x_i is equal to either or . Determine how many distinct numbers in the interval are representable.

Constraints

a, b, A, B are integers. 0 \leq a, b \leq 10\ 000 0 \leq A \leq B \leq 10^7

Input

The input consists of a single line containing , , , .

Output

Output the number of representable numbers using and in the interval .

Examples

Example 1

Loading
Loading