#coding: UTF-8 import sys import re import itertools from math import sqrt from collections import deque ### defs ### ### main ### S = sys.stdin.readline().strip('\r\n') x,y=(0,0) dir = {'N':(0,1), 'E':(1,0), 'W':(-1,0), 'S':(0,-1)} for c in S: x += dir[c][0] y += dir[c][1] print(sqrt(x*x+y*y))