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