Calculate total days