S = list(input()) N = S.count('N') E = S.count('E') W = S.count('W') S = S.count('S') print('{}'.format(((N - S)**2 + (E - W)**2)**(0.5)))