first put them all in one collection, but do not have separate variables:
var numbers = new[]{a,b,c,d,f};
Then group them, find the counter of each group and see if any of your criteria match.
var isLargeGroup = numbers.GroupBy(n => n, (key, group) => group.Count() )
.Any(count => count >= 3);
Servy source
share