#include #include #include using namespace std; char str[105] = {}; int x, y; int main() { int i = 0; cin >> str; while(str[i]) { if(str[i] == 'N') y++; else if(str[i] == 'E') x++; else if(str[i] == 'W') x--; else if(str[i] == 'S') y--; i++; } x = abs(x); y = abs(y); cout << sqrt(x * x + y * y) << endl; return 0; }