Calculate Bacon Number