#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); string s; cin >> s; double x = 0, y = 0; rep(i,s.size()){ if(s[i] == 'N') y++; if(s[i] == 'E') x++; if(s[i] == 'W') x--; if(s[i] == 'S') y--; } cout.precision(17); cout << sqrt(x*x+y*y) << endl; }