#include using namespace std; int main(){ cout << fixed << setprecision(10); string S; cin >> S; int N = S.size(); int y = 0; int x = 0; for (int i = 0; i < N; i++){ if (S[i] == 'N'){ y++; } if (S[i] == 'S'){ y--; } if (S[i] == 'W'){ x--; } if (S[i] == 'E'){ x++; } } cout << hypot(x, y) << endl; }