Stacking items in inventory in Unreal

Regarding inventory, can someone answer a question for me? I have an item in the world, this item is added to the inventory with a value of 3. Then I take another item from the world and it is also added with a value of 3, but the total value of the item is 5. So I need that when I add the two items to the inventory, the item has a total value of 5, and then there will be 1 left over, and this 1 will be transformed into another item that will also be in the inventory with a value of 1.

Currently it looks like the second image, because of the “+” in the blueprint. When the value is greater than 5, it simply doesn’t combine them. In other words, in the part where I put a comment “preciso de um calculo aqui” I need something that makes it work as I described above.

The image below shows another way I tried to do it; it works almost as expected, but I had to change the maximum stacking value of the item to 6, which I didn’t think was right. Also, if I interacted with an item with two values ​​of 3, for example, they still wouldn’t join together, but I believe that’s because I didn’t create a logic for it to happen. So, what could be done here?