#include #include #include using namespace std; int main() { char c; int x=0, y=0; cin.tie(0); ios::sync_with_stdio(false); while (cin >> c) { if (c == 'N') y++; else if (c == 'S') y--; else if (c == 'E') x++; else if (c == 'W') x--; } cout << fixed << setprecision(3) << sqrt(x*x + y*y) << endl; return 0; }