#P1348. Couple Number Count

    ID: 14635 Type: Default 1000ms 256MiB

Couple Number Count

Couple Number Count

For an integer \(n\), if there exist two natural numbers \(x\) and \(y\) satisfying \(n = x^2 - y^2\), then \(n\) is called a Couple number.

Given two integers \(a\) and \(b\), count how many Couple numbers exist in the interval \([a, b]\).

Hint: Notice that \[ x^2 - y^2 = (x-y)(x+y), \] so an integer \(n\) can be expressed as a difference of two squares if and only if \(n \not\equiv 2 \; (\bmod\; 4)\].

inputFormat

The input consists of a single line containing two integers \(a\) and \(b\) (with \(a \le b\)), separated by a space.

\(1 \le a, b \le 10^{18}\) may be assumed.

outputFormat

Output a single integer which is the count of Couple numbers in the closed interval \([a, b]\).

sample

1 10
7