import math inputer = input() north=0 east=0 west=0 south=0 for hogaku in range(len(inputer)): if inputer[hogaku]=="N": north=north+1 if inputer[hogaku]=="E": east=east+1 if inputer[hogaku]=="W": west=west+1 if inputer[hogaku]=="S": south=south+1 tate = north-south yoko = east-west tete_k = int(math.pow(tate,2)) yoko_k = int(math.pow(yoko,2)) kyori =int(tete_k+yoko_k) print(round(math.sqrt(kyori),5))