Maximum Number of Occurrences of a Substring