package main import ( "fmt" "math" ) func main() { var s string var x, y int fmt.Scan(&s) for _, v := range s { switch v { case 'N': y++ case 'S': y-- case 'E': x++ case 'W': x-- } } fmt.Println(math.Sqrt(float64(x*x + y*y))) }