s = input() x = 0 y = 0 for si in s: if si=="N":y+=1 elif si=="S":y-=1 elif si=="W":x+=1 else:x-=1 print((x**2+y**2)**0.5)