It's not a problem with the $input identifier it's with how you are trying to use the echo command,

/echo [color] [-deghiNtsaqlbfnmr] [#channel|[=]nick] <text>
Prints text in the specified window using the specified color (0 to 15).

echo -a %variable
should echo the number.