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