Provable Estimation of the Number of Blocks in Block Models