function calc(n) {
n = n.split(/ ?\/ ?/);
var res = n[0], i;
for(i=1; i<n.length; i++) res /= n[i];
return res;
}
alert( calc('9/3') ); //3
alert( calc('16 / 2/2') ); //4
alert( calc('5/2.5') ); //2
alert( calc('10 / 1 / 2 / 2') ); //2.5
alert( calc('125/5/5/5') ); //1