There is a JavaScript function called SSI_CustomGraphicalCheckbox that gets run every time a graphical check box is clicked. Using JavaScript you can provide your own instructions specifying what should happen when a box gets clicked. So if your question name is "q1" and your total box has an id of "total" then you can do something like
function SSI_CustomGraphicalCheckbox(GraphicalCheckboxObj, InputObj, blnCheck) {
var i = 0;
var sum = 0;
for (i = 1; i <= 40; i++) {
sum += parseInt(SSI_GetValue("q1_" + i));
}
document.getElementById("total").value = sum;
}
to show the total number of boxes checked.