We are planning an orienteering game. The aim of this game is to arrive at the goal (G) from the start (S) with the shortest distance. However, the players have to pass all the checkpoints (@) on the map. An orienteering map is to be given in the following format.  ########  #@....G#  ##.##@##  #..@..S#  #@.....#  ######## In this problem, an orienteering map is to be given. Calculate the minimum distance from the start to the goal with passing all the checkpoints.