how I can sum a particular group

say;

grp A 15
grp A 10
grpb 5
grpb 3

totalgroup A 25