import math S = str(input()) x = abs(S.count('W') - S.count('E')) y = abs(S.count('N') - S.count('S')) print(math.sqrt(x ** 2 + y ** 2))