We describe the ice rink using the following notation:
(#) -- Wall
(.) -- Free space
(S) -- Sally's starting position
(D) -- Dad's position.
For example, in the following ice rink, the shortest path is 18 steps.
Here is a text file of 5 ice rinks of size \( 20 \times 20 \). The rinks are separated by hyphens.
Find the sum of the shortest paths of these five \( 20 \times 20 \) ice rinks.
Note: Sally has to stop at her father's position. She will slide past him if there are no walls.