Add number fields only if not null

Add number fields only if not null

How do I add number fields that are not null? So far, I have script that adds number fields, but I keep getting an error message when some of the fields are null. 

  1. input.Total = Amount + Amount1 + Amount_3 + Amount_4 + Amount_5;
For example, if Amount_3  is null, I will get an error message. I do not want to add 0 to any fields that are null. If they are null, I would like to keep it that way. Is there a way to only add fields that are not null?