hola, logre hacer el script de suma pero no se como hacer para que con un valor que le ingre por una caja de texto se multiplique por ese numero

<html>
<head>
<script>
var total=0;

function sumar(valor) {
total += valor;
document.formulario.total.value=total;
}

function restar(valor) {
total-=valor;
document.formulario.total.value=total;
}
</script>
</head>
<body>
<form name=formulario>
<input name="checkbox" type="checkbox" onClick="if (this.checked) sumar(1); else restar(1)" value="checkbox">$1<br>
<input name="checkbox" type="checkbox" onClick="if (this.checked) sumar(2); else restar(2)" value="checkbox">$2<br>
<input type="text" name="total" value="0">
</form>

</body>

</html>