Hints and tips:
...Keep a running total of the number of shares received (A) and their base cost (B)....
International Edition