import math let s = readLine stdin var x, y = 0 for c in s: case c of 'N': inc y of 'S': dec y of 'E': inc x of 'W': dec x else: discard echo sqrt toFloat x ^ 2 + y ^ 2