#include using namespace std; int main(){ char A, B; cin >> A >> B; string s = "NESW"; int i, j; for(int k = 0; k < 4; k++){ if(A == s[k]) i = k; if(B == s[k]) j = k; } int ans = j - i; if(ans < 0) ans += 4; cout << ans; }