Logo C++ Online Judge

C++

时间限制:1 s 空间限制:512 MB
TA:
统计

Day of Year

Given a Gregorian year Y and a 1-indexed day-of-year d, determine which month (112) the day belongs to.

Use the leap-year rule: a year is leap if it is divisible by 400, or divisible by 4 but not by 100.

The input is guaranteed valid:

  • $Y \ge 1$;
  • d is within 1..365 for a common year and 1..366 for a leap year.

Input

One line with two integers: Y d.

Output

One line with a single integer: the month number (112) that contains day d of year Y.

Sample

Input

2025 322

Output

11

Explanation: 2025 is not a leap year; day 322 is Nov 18.