import math a = input() N = math.sqrt(a.count("N")) S = math.sqrt(a.count("S")) W = math.sqrt(a.count("W")) E = math.sqrt(a.count("E")) print(math.sqrt(N**2 +S**2 +W**2 +E**2))