You could use bc. E.g.,
$ echo "25 + 5" | bc
30
Alternatively bc <<< 25+5 will also work.
Or interactively, if you want to do more than just a single simple calculation:
$ bc
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
25 + 5
30
The GNU implementation of bc -q will jump into bc right away without theprints that header/copyright info on start-up when both its stdin and stdout go to a terminal. You can suppress it with the (GNU-specific) -q option. For more information see the bc man page