//washing_machine61

#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>

using namespace std;

int main(){
  string x;
  double distns = 0.0;
  double distew = 0.0;
  cin >> x;
  for(int i =0; i < x.size(); i++){
    if(x[i] == 'N'){
      distns += 1.0;
    }
    if(x[i] == 'S'){
      distns -= 1.0;
    }
    if(x[i] == 'E'){
      distew += 1.0;
    }
    if(x[i] == 'W'){
      distew -= 1.0;
    }
   }	
    cout << sqrt(distns*distns + distew*distew) << '\n';
  
}