Lemmings on a ledge

[Vladislav Shcherbina told me this problem.]

A ledge is 1 meter long. On it are N lemmings. Each lemming travels along the ledge at a constant speed of 1 meter/minute. A lemming continues in the same direction until it either falls off the ledge or it collides with another lemming. If two lemmings collide, they both immediately change their directions. Initially, the lemmings have arbitrary starting positions and starting directions. What is the longest time that may elapse before all lemmings have fallen off the ledge?

[Michael Jackson suggested the following variation of the problem: Suppose the ledge is not horizontal, but is leaning. A lemming now travels up the ledge at a speed of 1 meter/minute and travels down the ledge at a speed of 2 meters/minute. What is the longest time before all lemmings have fallen off?]