#include <bits/stdc++.h>
using namespace std;

int main()
{
int i;
int X;
int Y;
char S[ 110 ];
char C;

	cin >> S;

	X = 0;
	Y = 0;
	i = 0;
	C = S[ i ];
	while( C != '\0' )
	{
		if( C == 'N' )
			Y++;
		else if( C == 'S' )
			Y--;
		else if( C == 'E' )
			X++;
		else if( C == 'W' )
			X--;

		i++;
		C = S[ i ];
	}

	cout << sqrt( (double) ( X * X + Y * Y ) ) << endl;

	return 0;
}