read a;for i in $a;{ d[i]+=$i\ ;} echo ${d[@]}|{ read a b c echo $[(c+=b+=a)