Optimal investment in smart MV/LV substations to improve continuity of supply