Completed the Bean-Counting Problem