Question 884727
This is very similar to <a href=http://www.algebra.com/algebra/homework/Rate-of-work-word-problems/Rate-of-work-word-problems.faq.question.884729.html>This Question</a>, but in case it's not a duplicate, let's go ahead and work it.
.
To do this type of problem, we work backward.
At the end, Gloria has 9 pieces left.  She gave friend 2 half; therefore, she gave him 9 pieces.
Before meeting friend 2, Gloria had 18 pieces.  She gave friend 1 half; therefore, she gave her 18 pieces.
18 + 18 = 36 pieces to start with.