How many storeys are in the castle inherited by David Gregory?