ls = list(input()) a = 0 b = 0 for i in ls: if i == "N": a += 1 elif i == "S": a -= 1 elif i == "E": b += 1 else: b -= 1 print((a*a+b*b)**0.5)