#include using namespace std; int main() { int a, b; cin >> a >> b; int c = a %4; int d = 3-(a/4+b/4); cout << d*4+c; }