a Latin square is an $n × n$ array filled with n different symbols, each occurring exactly once in each row and exactly once in each column.
So, Assume that an integer like $4$ is given. How many $4 × 4$ latin squares exist? Generally, What's the idea for counting them ?
For order 4, there's not many. We can just enumerate them using a backtracking algorithm (essentially a depth first search: we proceed cell-by-cell, filling it in in all possible non-clashing ways, then continuing to the next cell). Here's some GAP code I just whipped up:
which displays the 576 Latin squares of order 4. (It even works for the 161280 Latin squares of order 5.)
Enumeration in this way is not so easy for larger orders (Sade's algorithm is the only method that's been used for orders 8 or more, but it's non-constructive [as it must be--the numbers are simply too large]).