S = input() print(((S.count('N') - S.count('S')) ** 2 + (S.count('E')- S.count('W')) ** 2) ** 0.5)