#include <iostream>
#include <vector>
#include <cstdio>
#include <sstream>
#include <map>
#include <string>
#include <algorithm>
#include <queue>
#include <cmath>
#include <set>
using namespace std;


int main(){
	string S;
	cin >> S;
	int x = 0;
	int y = 0;
	for(int i=0; i<S.size(); i++){
		if(S[i] == 'N') y++;
		else if(S[i] == 'E') x++;
		else if(S[i] == 'W') x--;
		else if(S[i] == 'S') y--;
	}

	printf("%.5f\n", sqrt(x*x + y*y));
	
	return 0;
}