Static path approximation for the nuclear partition function