In the sequence {an}, if ai+ai+1+ai+2 is odd, then (ai,ai+1,ai+ is called a "great triplet". For example, in the sequence 6,4,2,1,3,5, there are exactly two great triplets: (4,2,1) and (1,3,5). If a1,a2,⋯,a2021 is a permutation of 1,2,⋯,2021, determine the maximum number of great triplets in the sequence a1,a2,⋯,a2021.