Negative values??

analogRead returns an integer value in the range of 0 to 1023:
http://www.arduino.cc/en/Reference/AnalogRead

But if val is an int type, and if its value exceeds 32,767, "they 'roll over' back to their minimum capacitiy":
http://www.arduino.cc/en/Reference/Int

So you can use long type for val. Its limits is 2,147,483,647. Then yous sum will not exceed limits when using 300.

[edit]I didn't see your last post. Almost at same time...[/edit]