#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>
#include <ctype.h>
#include <set>
#include <sstream>

using namespace std;


int main() {
	int i, j, k;
	string s;

	cin >> s;

	int x = 0, y = 0;

	for (i = 0; i < s.length(); i++) {
		if (s[i] == 'N') {
			y--;
		}
		else if (s[i] == 'E') {
			x++;
		}
		else if (s[i] == 'W') {
			x--;
		}
		else if (s[i] == 'S') {
			y++;
		}
	}

	cout << fixed << sqrt(pow(abs(x),2) + pow(abs(y),2)) << endl;


	getchar();
	getchar();
	return 0;
}