from collections import Counter import math s = input() c = Counter(s) print(math.hypot(c['N'] - c['S'], c['E'] - c['W']))