add a function to caculate each item amount from input