M.Gardner in his book "Mathematical puzzles and diversions" states that the following 2x4 map
$$ \begin{array}{|c|c|} \hline 1 & \phantom{1} & \phantom{1} & \phantom{1} \\ \hline \phantom{1} & \phantom{1} & \phantom{1} & \phantom{1} \\ \hline \end{array} $$
can be folded in 40 different ways (along 7 segments shown) that the cell with 1 on it will be the upper one.
How to count all these ways and prove that there are exactly 40 of them?