Math doesn't work?

and brick1 is -500 I checked it in the debugger