There are many different functions $f(m,n)$ for telling the number of Hamiltonian paths going from $LL$ (lower left) to $UR$ (upper right) depending on what values $m$ and $n$ take. For example, for $m=3,\ n>1,\ f(3,n)=2^{(n-2)}$. For $m=4$ and so on, they get pretty complicated. Read it if you want to know more!