In a line, one red flag, three white flags, and two blue flags are arranged such that no two adjacent flags are of the same color. How many different arrangements are possible?