P27425 [AtCoder] November 30
入门
题目描述

Problem Description

A "month-end day" is the last day of a month, such as November 30, 2019.

Integers $ M_1, D_1, M_2, D_2 $ are given as input.
It is known that the next day after $ 2019 $ year $ M_1 $ month $ D_1 $ day is $ 2019 $ year $ M_2 $ month $ D_2 $ day.
Determine if $ 2019 $ year $ M_1 $ month $ D_1 $ day is a month-end day.

Input Format

Input is given from the standard input in the following format:

$ M_1 $ $ D_1 $ $ M_2 $ $ D_2 $

Output Format

Output 1 if $ 2019 $ year $ M_1 $ month $ D_1 $ day is a month-end day, otherwise output 0.

Sample Input and Output

Sample Input #1

11 16
11 17

Sample Output #1

0

Sample Input #2

11 30
12 1

Sample Output #2

1

Notes/Hints

Constraints

  • Both $ 2019 $ year $ M_1 $ month $ D_1 $ day and $ 2019 $ year $ M_2 $ month $ D_2 $ day are valid dates in the Gregorian calendar.
  • The next day after $ 2019 $ year $ M_1 $ month $ D_1 $ day is $ 2019 $ year $ M_2 $ month $ D_2 $ day.

Sample Explanation 1

November 16 is not a month-end day.

Sample Explanation 2

November 30 is a month-end day.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
11 16 11 17
样例输出
0