YOU are given a portfolio of stocks and ETFs, and a stock name, both of whcih are in String format. Calculate how many shares of the stock the portfolio has.
E.g
"{30GOOGLE, 50AMZN, 20MSFT, 100S&P500{2GOOGLE, 5FB, 10INTEL}, 40ETF1{5S&P500, 10GOOGLE}}" , "GOOGLE"
The total numbe of shares of GOOGLE is :
30 + 100X2 + 40X(5X2 + 10) = 1030 Shares of GOOGLE
Explanations: