#include #include #include using namespace std; int main() { string str; cin >> str; int n = 0,e = 0,w = 0,s = 0; for(int i = 0; i < str.length(); i++){ if(str[i] == 'N') n++; else if(str[i] == 'E') e++; else if(str[i] == 'W') w++; else s++; } cout << sqrt(pow(abs(n-s),2)+pow(abs(e-w),2)) << endl; return 0; }