Finds the number of elements equal to the input in an array
Working version