This is a really common method of counting known as "stars and bars". If you want more reference information, I'd highly recommend looking to wikipedia or other sources online. The basic idea is that we can think of 50 votes as "50 balls" or "stars" laid out in a row.
These 50 stars are divided by 3 "bars", which form 3 groups. You can picture it like this:
if the O's are balls, and the |'s are dividers, we have:
O O O O O O | O O O O O | O O O O | O O .. ..... x 50.
These bars divide how many votes each of the four candidate gets(can you see why there are 3 bars? because if n is the number of bars there are, n+1 regions are formed from n bars).
Because we want to see how many votes each candidate could get, the answer is stars and bars' non negative form(there are two forms of stars and bars, watch out!)
With stars and bars, we get the equation:
(50+4-1) c (50), or (53c50). This gives us 53*52*51/3!
This simplifies to:
53*26*17 = 23426 totals