get the max value from the frequency