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