For once I'll post dirt, ugly code – which will save you the if/else statements:
var max = Math.max(a,b,c);
var cnt = 1*(a==max)+1*(b==max)+1*(c==max);
But keep in mind that readability is considered important these days, especially if you ever consider doing this as a job. So you might be better of using something readable and extensible, i.e. using a forEach function on [a, b, c].