import math ls = list(input()) n = ls.count('N') e = ls.count('E') w = ls.count('W') s = ls.count('S') y = abs(n - s) x = abs(e - w) print(math.sqrt(x ** 2 + y ** 2))