A numerical study of two interacting coronal mass ejections