Formula to calculate total number of products selected in a Lookup field

Formula to calculate total number of products selected in a Lookup field

Hello there,

I created a form to log all the orders received for certain products and the quantity ordered. Here's below you can see its related report:


Now, I am creating another form, where I can select anyone of the items in "My Products" through a Lookup field and I am adding a formula field where I wish to display the Total number of items ordered for the selected products in the lookup field (see below picture)


I tried to use the following formula:  input.My_Products.size()  , however it doesn't work and only display a count of listed products and not full sum of the quantity coming from the " My Products report" (in the above example, it should be 520+688= 1,208

Can you help me figuring out the proper formula I should use to get the right calculation?

Thanks