Calculating share profits with multiple purchases