Four towns receive state funds for housing