#coding: utf-8 ##yuki_113 import math s=[] s=raw_input() n=s.count('N') e=s.count('E') w=s.count('W') s=s.count('S') res=math.sqrt((n-s)**2+(e-w)**2) print res