This is not so hard with SelectMany
var result = messages
.SelectMany(m => m.Recipient.Groups)
.GroupBy(t => t.GroupType)
.Select(g => new { gType = g.Key, count = g.Count()});
Then result.Dump() - in LinqPad
Full source for my test code is here: https://gist.github.com/hoganlong/5841555