sqrt' [x, y] = sqrt ((x^2) + (y^2)) news s [x, y] = case s of 'N' -> [x, y + 1] 'E' -> [x - 1, y] 'W' -> [x + 1, y] 'S' -> [x, y - 1] _ -> [x, y] main = getLine >>= print . sqrt' . foldr (news) [0.0, 0.0]