#include using namespace std; int main() { int x, y; cin >> x >> y; int cal = (max(x, y)+4)%12; if (min(x, y) == cal) cal+=4; cout << cal << endl; }