/* * Author: nskybytskyi * Time: 2022-01-13 15:08:45 */ #include using namespace std; int main() { cin.tie(0)->sync_with_stdio(0); char a, b; cin >> a >> b; string s = "NESWNESW"; int i = s.find(a); int j = s.find(b, i); cout << j - i << "\n"; return 0; }