Every pair of communities in a county are linked directly by exactly one mode of transportation: bus, train, or airplane. All three modes of transportation are used in the county, with no community being serviced by all three modes and no three communities being linked pairwise by the same mode. Determine the maximum number of communities in this county.