#include using namespace std; int main(){ string str; cin >> str; sort(str.begin(),str.end()); int e = 0,n = 0,s = 0,w = 0; for(int i = 0; i < str.size(); i++){ if(str[i] == 'E') e++; if(str[i] == 'N') n++; if(str[i] == 'S') s++; if(str[i] == 'W') w++; } double tate = abs(n-s); double yoko = abs(e-w); cout << sqrt(tate*tate + yoko*yoko) << endl; return 0; }