Skip to main content

~/algor $ cat contests/round-8/H

H. Knight move

Problem H ICPC rules 1000 ms 64 MB

Two different squares of a chessboard and are given. A square is given as : is the column number (from left to right), is the row number (from bottom to top). A knight moves in an L shape: squares in one direction and square in the perpendicular direction. Check whether the statement is true: “the knight on square can move to square in one move”.

A knight's L-shaped move on a chessboard

Input

One line with four positive integers: , , and .

Output

One integer: if the statement is true, otherwise .

Note


The squares are different.

Examples

Input #1
4 4 5 6
Output #1
1
Input #2
4 4 6 6
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.