Calc: Extract unique values and add the numbers next to it

Gosh, I dont know how to describe this seemingly simple problem I have. An example is so much easier.

Say I have two columns :

Apple      5
Orange     3
Apple      1

Now I want to automatically create two columns where one is all the unique value in column A and the other is the aggregate of all the numbers that corresponds to that value. So for the table above it would create :

Apple  6
Orange 3

I found out how to extract the unique values here : Find distinct values in a column formula for calc
but I don’t know how to add the numbers next to them
There are hundreds of items and potentially more incoming. So I’m wondering if Libre can automate the task

Instead of using all kinds formulas, Libre Calc actually already have a powerful tools built in for these kinds of job. I finally tried Pivot Table (Data - Pivot Table - Create Table) and it solved everything in a matter of seconds.