from math import sqrt def main(): s = input() x, y, = 0, 0 for d in s: if d == 'N': y += 1 elif d == 'E': x -= 1 elif d == 'W': x += 1 elif d == 'S': y -= 1 print(sqrt(x ** 2 + y ** 2)) if __name__ == '__main__': main()