sergylt,
далее сами, вы уже 3 раза меняли условие задачи
<form name="form" action="http://">
<fieldset class="checkbox_buy1">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
</fieldset>
<fieldset class="checkbox_buy1">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
</fieldset>
<div class="rezultat"></div>
<input id="fieldset1" name="total" type="text" value="">
<input id="fieldset2" name="total" type="text" value="">
</form>
<script>
window.addEventListener("DOMContentLoaded", function() {
var a = document.querySelector("form"),
b = document.querySelector(".rezultat"),
d = a.querySelectorAll("[name='total']");
a.addEventListener("change", function() {
b.innerHTML = "Total: " + [].reduce.call(a.querySelectorAll("fieldset"), function(a,b,i) {
var c = b.querySelectorAll(":checked").length;
d[i].value = (c > 5 ? (c - 5)*5 + 50 : c * 10)
return a + +d[i].value
}, 0)
})
});
</script>