A car travels half the distance with a constant speed of 40 kmph and the remaining half with a constant speed of 60 kmph. The average speed of the car in kmph is: