#SUMITB2019A. November 30

November 30

Score: 100100 points

Problem Statement

In this problem, a date is written as Y-M-D. For example, 20192019-1111-3030 means November 3030, 20192019.

Integers M1,D1,M2M_1, D_1, M_2, and D2D_2 will be given as input. It is known that the date 20192019-M2M_2-D2D_2 follows 20192019-M1M_1-D1D_1. Determine whether the date 20192019-M1M_1-D1D_1 is the last day of a month.

Constraints

  • Both 20192019-M1M_1-D1D_1 and 20192019-M2M_2-D2D_2 are valid dates in the Gregorian calendar.
  • The date 20192019-M2M_2-D2D_2 follows 20192019-M1M_1-D1D_1.

Input

Input is given from Standard Input in the following format:

M1M_1 D1D_1

M2M_2 D2D_2

Output

If the date 20192019-M1M_1-D1D_1 is the last day of a month, print 1; otherwise, print 0.

11 16
11 17
0

November 1616 is not the last day of a month.

11 30
12 1
1

November 3030 is the last day of November.