#include using namespace std; int main() { double x = 0, y = 0; string s; cin >> s; for (char &c : s) { if (c == 'N') x--; if (c == 'E') y--; if (c == 'W') y++; if (c == 'S') x++; } cout << sqrt(x*x + y*y) << endl; }