function max() {
    local m=$1
    while [ $# -gt 0 ]
    do
        m=$[$m>$1?$m:$1]
        shift
    done
    echo $m
}

read A B C
echo $(max $(($A$B + $C)) $(($B$A + $C)) $(($A$C + $B)) $(($C$A + $B)) \
           $(($B$C + $A)) $(($C$B + $A)) )
