Let us consider a collection G of codewords of length n over an alphabet of size s. Let t1,…,ts be nonnegative integers. What is the maximum of ∣G∣ subject to the condition that any two codewords should have at least ti positions where both have letter i (1≤i≤s). In the case s=2 it is a longstanding open question. Quite surprisingly, we obtain an almost complete answer for s≥3. The main tool is a correlation inequality.