The correct option is (D): 40
Explanation: Let A, B, C, and D represent the number of cards they have. From the equations, we have:
B + 8 = C and A = C + 5 (from A's statement).
B + D = 50.
Solving these gives A = 40 cards after substituting and simplifying the equations. Thus, A has 40 cards.