Explanation:
x = amount of shares for $6.25
y = account of shares for $6.50
x + y = 500
x×6.25 + y×6.5 = 3218.75
x = 500 - y
(500 - y)×6.25 + y×6.5 = 3218.75
3125 - y×6.25 + y×6.5 = 3218.75
0.25×y = 93.75
y = 375
x = 500 - 375 = 125
so, he bought
375 shares of $6.50
125 shares of $6.25