first stages of ranking a hostpital based on number inputed and returning the first result if its a tie