S = input() X = S.count('E') - S.count('W') Y = S.count('N') - S.count('S') print((X**2 + Y**2)**0.5)