The castle David Gregory inherited in 1664 has how many storeys?