So first find the least common multiple of 3, 5, 7 and 9.
5*7*9=3 15
Then there was no good way to die, so I began to set the total number of people to 3 15n- 1.
Because 1 1*28=308.
3 15n- 1 =(308+7)n- 1 = 308n+7n- 1
Because 308n is divisible by 1 1, 7n- 1 is required to be divisible by1.
When n=8, 7n- 1=55 is divisible by 1 1.
So the total number of people is 315 * 8-1= 2520-1= 2519.
If the number of people is unlimited, just add 8 to 1 1 at a time.
The total population is 3 1 5 * (8+11n)-1(n = 0,1,2, 3, 4 ...).