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