Andy's average driving speed for a 4-hour trip was 45 miles per hour. During the first 3 hours he drove 40 miles per hour. What was his average speed for the last hour of his trip?