#include <bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; int x=0,y=0; for(int i=0;i<s.length();++i){ switch(s[i]){ case 'W': x--;break; case 'E': x++;break; case 'N': y++;break; case 'S': y--;break; }} cout<<sqrt(x*x+y*y)<<endl;}