There are 12 months in a year, thus there will be 12 x 2 = 24 months in the next two years.
As Ratan buys shirts every 3 months, he will buy shirts in months which are in mulitples of 3, i.e. 3, 6, 9, 12, 15, 18, 21, 24.
Thus, he will buy 8 shirts in next 2 years, i.e. 24 months.
Similarly, he will buy jeans in months which are in multiples of 4, i.e. 4, 8, 12, 16, 20, 24.
Thus, he will buy 6 jeans in next 2 years, i.e. 24 months.
Hence, after two years he will have a total of 23 + 8 + 6 = 37 clothes.