Calculate longest periods of true values