Solve SRM 161, Div 2, Problem CardCount