It doesn't determine the amount, it resets them all to 0.
// lets say SYMBOLS == 20
for (int z = 0; z < SYMBOLS; z++) means z starts at 0
if z < symbols (20) means as long as z less than SYMBOLS (20)
z++ mean then add 1 to z
So it counts from 0 to 20 using z as the counter variable.
{ starts a block of code
symbolcount[z] = 0; as the value of z increases from 0 to 19, this changes the value of the variable symbolcount[] to 0;
} ends the code block