function for calculating the sum of the self information of intersecting tokens