Distinct Operations

You are given an array A[] of N integers.In one operation, you can choose two distinct elements and remove both of them from the array.You can apply this operation till array do not become empty or there are no two distinct elements.Your task is to return the maximum number of times you can apply this operations to the given array.