#include #include using namespace std; int main(){ string s; cin >> s; int a,ns,ew; ns = 0; ew = 0; a = s.size(); for (int i = 0; i < a; i++) { if (s[i] == 'N') { ns++; }else if (s[i] == 'E') { ew++; }else if (s[i] == 'S') { ns--; }else if (s[i] == 'W') { ew--; } } float result = sqrt(ns * ns + ew * ew); cout << result << "\n"; return 0; }