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