If we denote by C the set of all possible words of length n (not necessarily from the language), we have Card(C)=2n. If x and y are arbitrary words from C, let d(x,y) be the number of positions at which the corresponding letters are different (the Hamming distance). Obviously, d(x,x)=0 and d(x,y)=d(y,x). For each x∈C, we define the set Cx={y∈C∣d(x,y)≤1}. It is not difficult to see that Card(Cx)=n+1.
If a,b are words of length n from the given language, then d(a,b)≥3, hence Ca∩Cb=∅.
Let D be the set of all words of length n from the language. Then ⋃a∈DCa⊂C, which implies Card(⋃a∈DCa)≤Card(C). But Card(⋃a∈DCa)=(n+1)⋅Card(D), so that (n+1)⋅Card(D)≤2n, therefore Card(D)≤n+12n, and the conclusion follows.