#include #include using namespace std; int main() { map table; table['N'] = 0; table['E'] = 1; table['S'] = 2; table['W'] = 3; char a, b; cin >> a; cin >> b; auto ans = (table[b] + 4 - table[a]) % 4; cout << ans << endl; }