i=j=0 for x in input(): i+=1if x=='S'else-1if x=='N'else 0 j+=1if x=='E'else-1if x=='W'else 0 print((i*i+j*j)**.5)