calculate cash