A 3 * 3 square grid is called as magic square, if sum of elements in each row, column, and corner to corner diagonal are same. There are nine distinct elements in a 3 * 3 magic square. From given nine elements (e1, e2, e3, e4, e5, e6, e7, e8, and e9), you may or may not create a 3* 3 magic square. You can create the magic square from nine elements given in example 1 whereas you cannot create the magic square from nine elements given in example 2.
Input Format
Space separated 9 integers in ascending order
Output Format
Single number, either 0 or 1, where 0 if magic square cannot be created and 1 if magic square can be created.
Constraints
No Constraints
Example
Input
3 4 5 6 7 8 9 10 11
Output
1