How many periods of works are in the records for the medieval building?
return the  medieval building ;return records of #1 ;return works that are in  #2 ;return periods of #3 ;return number of  #4
['select', 'project', 'project', 'project', 'aggregate']