# import sys; input = sys.stdin.buffer.readline # sys.setrecursionlimit(10**7) from collections import defaultdict con = 10 ** 9 + 7; INF = float("inf") def getlist(): return list(map(int, input().split())) #処理内容 def main(): X = 0; Y = 0 S = input() for i in S: if i == "N": Y += 1 elif i == "S": Y -= 1 elif i == "E": X += 1 else: X -= 1 ans = (X ** 2 + Y ** 2) ** 0.5 print(ans) if __name__ == '__main__': main()