Calculating the shared leaf set sizes