First. The input to bc should be an expression, not a computed value.
Code:
ans=`echo 1 + 3 |bc`
Second. The 'expr' command requires the variables and operators to be separated by space.
Code:
count=`expr $count + 1`
Three,
You initialize ans to 1, but change it anyway before it is used, and at the end, you print it with a literal that suggests that you have summed the value of each expression calculated, but nowhere do you accumulate the answer.
You need to add
Code:
total=`expr $total + $ans`
and change the last line to echo total instead of ans.