Hello,
I am sure that you are displaying type 3 and 53 inside a loop. So, what you can do is take two variables for type3 and 53. Inside your loop after displaying all of your cell you can create a program lines and there you can put sum3 = sum3 + itab-amount.
sum5 = sum5 + itab-amount.
You can also take a look into subtoal in smartforms.
Thanks & Regards,
Abhijit