The figure may be labelled as shown.
The, simplest triangles are ABI, BGI, GHI, HAI, BCJ, CFJ, FGJ, GBJ, CDK, DEK, EFK and FCK i.e. 12 in number.
The triangles composed of two components each are ABG, BGH, GHA, HAB, BCF, CFG, FGB, GBC, CDE, DEF, EFC and FGD i.e. 12 in number.
The triangles composed of four components each are AGC, BFD, HBF and GCE i.e.4 in number.
Thus, there are 12 + 12 + 4 = 28 triangles in the given figure.
The squares composed of two components each are BJGI and CKFJ i.e. 2 in number.
The squares composed of four components each are ABGH, BCFG and CDEF i.e. 3 in number.
Total number of squares in the figure = 2 + 3 = 5.