how many episodes does gotham season 3 have