let f (x,y) = function | 'N' -> x,y+1. | 'E' -> x+1.,y | 'W' -> x-1.,y | 'S' -> x,y-1. | _ -> failwith "error!" let x,y = stdin.ReadLine() |> Seq.fold f (0.,0.) let s = sqrt((x*x)+(y*y)) printfn "%2.5f" s