By air, the distance from city A to city B is 3005 miles less than the distance from city C to city D. If the total of these two distances is 7865 miles, find the distance from city C to city D