Under construction

Still being built. Things may change

I Want to Go to DIMIGO!

Time limit1sMemory limit1024 MB

Summary
Given a page range from A to B, find the fewest photos, where one photo can capture a single page or an open spread of pages 2k-1 and 2k.
Level

Easy2 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

ecode attended an admissions briefing because ecode wanted to go to DIMIGO. Wanting to learn more about the school, ecode received a booklet with information about it.

Each sheet of the booklet has two pages. When a spread is open, the left side is the odd-numbered page and the right side is the even-numbered page.

ecode wants to photograph the contents from page AA to page BB of this booklet. Photographing every page one by one is tedious, so when all the pages to be saved fit on one open spread, ecode tilts the phone sideways and captures that part at once.

The image below shows the best way to capture pages 4 to 6.

Tilting the phone vertically to photograph page 4 alone, then tilting it horizontally to capture pages 5 and 6 together, saves the desired pages in 2 shots.

Find the minimum number of photos needed to save every page from page AA to page BB.

Input

The first line contains two integers AA and BB, the first and last page to photograph, separated by a space. (1≤A≤B≤1 000)(1\leq A \leq B \leq 1\,000)

Output

Print the minimum number of photos needed to save every page from page AA to page BB.

Hint

The booklet is thick, with up to 1 0001\,000 pages, because the school has so many advantages to explain. It could have been much longer, but for the reader's sake it was summarized heavily.

Examples1

  1. Example 1

    Input
    5 11
    
    Expected output
    4