2004 AIME I Problem 6

An integer is called snakelike if its decimal representation a_{1} a_{2} a_{3} \ldots a_{k} satisfies a_{i}<a_{i+1} if i is odd and a_{i}>a_{i+1} if i is even. How many snakelike integers between 1000 and 9999 have four distinct digits?