The answer is 16.
With more than 16 switches in a ring topology the RSTP protocol start to fail due to IEEE defined timings, default values and dropping STP packets.
Between 8 and 16 you need to modify STP Max_Age and Forward_Delay to cope with your...