Use a Query expression to retrieve all Quotes that are related to Opportunity. Make sure to grab totalAmount from the Quote. After you've retrieved the Quotes, use a foreach loop to go through each Quote record and add the totalAmount value to
some sort of int variable.
Check the SDK for more information and sample code for Query Expressions