The stellar mass function of the most-massive galaxies at 3 ≤z < 5 in the UKIDSS Ultra Deep Survey | Synapse