method to calculate problem size. used in cloudCS.