While entering the room:
Grandmother + Mother + Daughter (Pregnant).
Mother => Daughter of Grandmother => No: of Daughters = 1
Daughter => Daughter of Mother => No: of Daughters =2.
Grandmother => Mother of Mother => No: of Mothers = 1
Mother => Mother of Daughter => No: of Mothers = 2.
On exiting:
Grandmother + Mother + Daughter + triplets (all female)
Mother => Daughter of Grandmother => No: of Daughters = 1
Daughter => Daughter of Mother => No: of Daughters = 2
triplets => Daughter of Daughter => No: of Daughters = 2 + 3 = 5.
Grandmother => Mother of Mother => No: of Mothers = 1
Mother => Mother of Daughter => No: of Mothers = 2.