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

~/algor $ cat problems/integer-ikki-vaqt-orasi

Seconds between two times

Easy 1000 ms 64 MB 11%
Share

Two times of the same day are given: the first is $h_{1}$ hours $m_{1}$ minutes $s_{1}$ seconds, the second is $h_{2}$ hours $m_{2}$ minutes $s_{2}$ seconds. Find how many seconds passed between them.

The seconds between two times

Input

The first line contains three integers: $h_{1}$, $m_{1}$ and $s_{1}$.
The second line contains three integers: $h_{2}$, $m_{2}$ and $s_{2}$.

Output

One integer — the number of seconds.

Note

$0 \le h_{1}, h_{2} \le 23$
$0 \le m_{1}, m_{2}, s_{1}, s_{2} \le 59$
The second time is not earlier than the first.

Examples

Input #1
8 30 0
9 15 30
Output #1
2730
Input #2
10 0 0
10 0 0
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.