# coding: utf-8 # yukicoder No.113 宝探し S = input() takara = [0, 0] # 宝の位置座標 for i in S: if i == "N": takara[1] += 1 elif i == "S": takara[1] -= 1 elif i == "E": takara[0] += 1 else: takara[0] -= 1 print("{:.3f}".format((takara[0] ** 2 + takara[1] ** 2) ** 0.5))