import math from collections import Counter cnt = Counter(input()) print(math.hypot(math.fabs(cnt["N"] - cnt["S"]), math.fabs(cnt["E"] - cnt["W"])))