import numpy as n a=input() print(n.linalg.norm(n.array([a.count("E")-a.count("W"),a.count("N")-a.count("S")])-n.array([0,0])))