The nonlinearity of an S-Box is defined as the non-linearity of its vectorial Boolean Function.
Let $F$ be the hamming distance between the set of all non-constant linear combinations of component functions and the set of all $n$-variable affine Boolean functions $A(n)$.
If we take two S-Box of $4 \times 4$ and $8 \times 8$ then
how many Affine function can be made from $4 \times 4$ and $8 \times 8$ S-boxes ?