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