In triangle ABC, if AC=8,BC=7 and D lies between A and B such that AD=2,BD=4, then the length CD equals