#include int rot(char x) { if(x == 'E') return 0; if(x == 'W') return 2; if(x == 'N') return 1; return 3; } int main() { int x, y; char ch; std::cin >> ch; x = rot(ch); std::cin >> ch; y = rot(ch); std::cout << ((x - y) % 4 + 4) % 4 << '\n'; }