Calculating The Number Of Microstates