Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/birinchi-vaqt-oldinmi

Is the first time earlier?

Easy 1000 ms 64 MB 16%
Share

Two times of the same day are given: $h_{1}$ hours $m_{1}$ minutes and $h_{2}$ hours $m_{2}$ minutes (in $24$-hour format). Check whether the statement is true: “the first time is earlier than the second”. If the times are equal, the statement is false.

Two points on a time axis; the first is to the left of the second

Input

One line with four integers: $h_{1}$, $m_{1}$, $h_{2}$ and $m_{2}$.

Output

One integer: $1$ if the statement is true, otherwise $0$.

Note

$0 \le h_{1}, h_{2} \le 23$
$0 \le m_{1}, m_{2} \le 59$

Examples

Input #1
9 45 10 5
Output #1
1
Input #2
14 30 14 30
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.