#include using namespace std; int main(){ int X,Y,Z; cin >> X >> Y; Y += 12; Z = 2*Y-X; Z %= 12; cout << Z << endl; }