#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)

int main(void)
{
  string s;
  cin >> s;

  int x = 0, y = 0;
  rep(i, s.size())
  {
    if (s[i] == 'N') y++;
    else if (s[i] == 'E') x++;
    else if (s[i] == 'S') y--;
    else if (s[i] == 'W') x--;
  }
  double ans = sqrt(x * x + y * y);

  printf("%.5f\n", ans);
  return 0;
}