ADD: find the combination of frames which uses the least space