Four Demons Lucifer, Abaddon, Crowley and Lilith have their own P, Q, R and S number of weapons respectively. Each weapon is denoted by some number which denotes the power of weapon. They all are fighting against each other. On each day they will fight with the weapon having same power. As soon as at least one of them doesn't have weapon of same magnitude as that of others that fight will stop. Simply put, if all of them have atleast one weapon that has the same magnitude of power, they can continue fighting with each other. Tell how many days the fight will go on.
Constraints
1 <= P, Q, R, S <= 100000
0 <= Magnitude of each weapon <= 1000000000
Problem Setter: Shiv Dhingra