S=list(input()) n=S.count("N") s=S.count("S") e=S.count("E") w=S.count("W") import math print((int(math.fabs(n-s))**2+int(math.fabs(e-w))**2)**(1/2))