package main import ( "bufio" "fmt" "math" "os" ) func main() { var x, y float64 scanner := bufio.NewScanner(os.Stdin) scanner.Scan() for _, d := range scanner.Text() { switch d { case 'N': y++ case 'E': x++ case 'W': x-- case 'S': y-- } } fmt.Println(math.Hypot(math.Abs(x), math.Abs(y))) }