Given the sequence 1,2,1,2,2,1,2,2,2,1,2,2,2,2,1, \ldots, find n such that the sum of the first n terms is 2008 or 2009.