On when to stop sampling for the maximum