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