Optimal life histories and the age-specific costs of reproduction.