#!/bin/sh


TOTAL=0


(
cat << EOF 
1
3
5
4
9
8
EOF
) | while read line
do
	TOTAL=`expr $TOTAL + $line`
done

echo $TOTAL

