Counting of objects distributed at random