Coupon Code for - buy any 3 items get cheapest one free

How would I create a coupon code for buy any 3 get cheapest free

For instance I have about 100 DVD movies - customer could buy any 3 of them and they would get the cheapest one free.

Many thanks