import sequtils,strutils,math var S = stdin.readline x,y : int ans : float for s in S: case s of 'N': y += 1 of 'E': x += 1 of 'W': x -= 1 of 'S': y -= 1 else: discard ans = x.abs.float * sqrt(1 + pow(y / x, 2)) echo ans