Input : A[ ] = {3, 3, 2}
Output: 0
Explanation: The array consists of 3, 3, 2 elements of 1st, 2nd and 3rd type respectively. By removing the array elements in the order {2, 1, 2, 3, 1, 3, 1}, a sequence is obtained in which no two consecutive elements are removed which are of the same type. Therefore, the count is 0.
Input: A [ ] = {1, 4, 1}
Output: 1
Explanation: The array consists of 1, 4, 1 elements of 1st, 2nd and 3rd type respectively. By removing the array elements in the order { 2, 3, 2, 2, 1, 2}, consecutive deletions of same type elements is reduced to 1. Therefore, the count is 1.