s = '8 3 4 4 5 9 9 5 2'
l = s.split()
sum([(int(item) * count) for item, count in list(collections.Counter(l).items()) if
    count > 1])
Finding the same numbers in an input and summing the paired numbers