Using a DATA step and two arrays (one to track the values and another to track the counts), you can loop through each observation's variable "values" for A through E identifying each unique instance and incrementing a counter.
might also find CALL SORTc/n() useful, to put the array values into order. Then as you go through the array of values, you only need to keep the latest value, it's counter and the highest value/count so far. It scales up better, and you won't need to search for the counter to update as you look at each (disordered) array value.
A SAS pre-processing SORT step gets the data into order, followed by the DATA step suggested. The use of two ARRAYs (in parallel, one for value and another for count) addresses the objective, using the DO I=1 TO DIM(); / END; with the "I" variable paralleling the two arrays.