dynamic computation of number of allowable cards