/* -*- coding: utf-8 -*- * * 1806.cc: No.1806 Rotating Golem - yukicoder */ #include #include using namespace std; /* constant */ const int M = 4; const char dcs[] = "NESW"; /* typedef */ /* global variables */ int cmap[128]; /* subroutines */ /* main */ int main() { for (int i = 0; dcs[i]; i++) cmap[dcs[i]] = i; char s[4], t[4]; scanf("%s%s", s, t); int a = cmap[s[0]], b = cmap[t[0]]; int n = (b + M - a) % M; printf("%d\n", n); return 0; }