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