Explicit Formula#2262

Explicit Formula

1 second
256 megabytes
Easy (≈1000)

Consider 10 Boolean variables x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_{10}. Consider all pairs and triplets of distinct variables among these ten. (There are 45 pairs and 120 triplets.) Count the number of pairs and triplets that contain at least one variable equal to . Define f(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_{10}) = 1 if this number is odd, and f(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_{10}) = 0 if this number is even.

Here is an explicit formula that represents the function f(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_{10}) correctly:

Input

The input contains 10 numbers x_1, x_2, \ldots, x_{10}. Each is either or .

Output

Output a single value: f(x_1, x_2, \ldots, x_{10}).

Examples

Example 1

Loading
Loading