How to calculate values of the items in the checkbox?