calculating total of cards