We have 1235 trees.
In each row is 24 trees.
Divide the number of trees by the maximum number in a row:

We see that the maximum can be 51 rows, next we rounding down to the nearest value (51).
We check how many trees will remain:
1235 - 51 * 24 = 11
11 trees will remain vacant.