Under construction

Still being built. Things may change

Rain Diary

Interview

Time limit1sMemory limit1024 MB

Summary
Given today's day number n and the day m from the record two weeks ago, print the day number for last Sunday's record.
Level

Easy1 of 10

Topics
Implementation, Math
Solved
No attempts yet

Problem

Petya lives in Saint Petersburg and is keen on meteorology. It is widely believed that it constantly rains in Saint Petersburg. Petya wants to test this claim with statistics. Every Sunday he records whether it rained that day. Each record is signed with the day number in the month, numbered from 1 to the number of days in that month (28 to 31, depending on the month).

Today Petya opened his diary and realized he forgot to make a record last Sunday. He remembers that there was heavy rain a week ago. He decides to make two records, one for today and one for last Sunday. He knows the current day number nn and sees the number mm written in the record from two weeks ago. What number should Petya sign his record for last Sunday with?

Input

The first line contains two integers nn and mm (1≤n,m≤311 \le n, m \le 31), the number of the current day of the month and the number written in the record from two weeks ago.

Output

Output a single number, the number Petya should sign his record for last Sunday with.

Examples1

  1. Example 1

    Input
    9 24
    
    Expected output
    2