from collections import Counter from math import sqrt a = Counter(input()) print(sqrt((a['N']-a['S'])**2+(a['E']-a['W'])**2))