Calculate dictionary size.