calculate total income