import math D = "EWNS" T = input() x = abs(T.count(D[0]) - T.count(D[1])) y = abs(T.count(D[2]) - T.count(D[3])) print(math.sqrt(x*x + y*y))