s = input() y = abs(s.count('N') - s.count('S')) x = abs(s.count('E') - s.count('W')) print((x**2 + y**2)**0.5)