The following languages are only available languages for the problems from the contest

VK Cup 2016 - Wild Card Round 1 (Unofficial Open Online Mirror):

- J

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

E. Divisibility Check

time limit per test

2 secondsmemory limit per test

64 megabytesinput

standard inputoutput

standard outputYou are given an array of integers. Check whether there exists a number in this array which is divisible by all other numbers in this array. Output 1, if such a number exists, and 0 otherwise.

Input

The only line of the input contains a list of space-separated integers *a*_{i} (1 ≤ *a*_{i} ≤ 100) — elements of the array. The size of the array is between 2 and 10, inclusive. Note that the size of the array is not given explicitly!

Output

Output 1 if there exists element of this array which is divisible by all other elements of the array, and 0 otherwise.

Examples

Input

6 12 4

Output

1

Input

3 13

Output

0

Input

26 13 12

Output

0

Codeforces (c) Copyright 2010-2019 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Dec/06/2019 17:14:17 (f3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|