import collections c = collections.Counter(input()) x = c['E']-c['W'] y = c['N']-c['S'] print((x*x+y*y)**0.5)