#include using namespace std; int main() { char A, B; cin >> A >> B; int a, b; switch(A) { case 'N': a = 0; break; case 'E': a = 1; break; case 'S': a = 2; break; default: a = 3; } switch(B) { case 'N': b = 4; break; case 'E': b = 5; break; case 'S': b = 6; break; default: b = 7; } return (b - a) % 4; }