Calculate total seconds