#include #include #include using namespace std; int a[2]; int main(){ string s;cin>>s; cout << fixed << setprecision(10); for(int i = 0; s.size() > i; i++){ if(s[i] == 'N')a[0]++; else if(s[i] == 'S')a[0]--; else if(s[i] == 'E')a[1]++; else a[1]--; } cout << (double)sqrt((a[0]*a[0])+(a[1]*a[1])) << endl; }