import math a = input() N = a.count("N") S = a.count("S") W = a.count("W") E = a.count("E") print(round(math.sqrt(N**2 +S**2 +W**2 +E**2),4))