A real estate office handles 50 apartment units. When the rent is $600 per month, all units are occupied. However, for each $40 increase in rent, one unit becomes vacant. Each occupied unit requires an average of $27 per month for service and repairs. What rent should be charged to obtain the maximum profit?