# -*- coding: utf-8 -*- S = input() x = y = 0 for c in S: if c == 'N': y += 1 elif c == 'E': x += 1 elif c == 'W': x -= 1 else: y -= 1 print(pow(x**2+y**2, 0.5))