How to Sum up two fields in to a custom field

How to Sum up two fields in to a custom field

Hello,

on products i have 2 custom fields(Unit Cost, gross profit) and on default field (Unit Price)

i want to edit field  gross profit that it will automatically ( subtraction function) update with  function  ( ( Unit Cost) - ( Unit Price))

i tried looking in "select field type" function but cant find it

can you please help me how to do it??

thx