Let the side of the square be x.
No. of students = x2 + 24
New side = x + 1
No. of students = (x + 1)2 – 25
APQ => x2 + 24 = (x + 1)2 – 25
=> x2 + 24 = x2 + 2 x + 1 - 25
=> 2x = 48
=> x = 24
Therefore, side of square = 24
No. of students = 576 + 24
= 600