import java.io.*;
import java.util.*;
public class HowManyNumbers {
try {
while (!st.hasMoreTokens()) {
if (s == null)
return null;
}
return st.nextToken();
return null;
}
}
while (true) {
int evens
= Integer.
parseInt( next
() ); int odds
= Integer.
parseInt( next
() );
if (evens == 0 && odds == 0) {
break;
}
out.println( solve(1, evens, odds) );
}
//
out.flush();
}
static long solve(int first, int evens, int odds) {
if (evens == 0 && odds == 0) {
return 2;
}
long ans = 0;
if (evens != 0) {
ans = (5L - first) * solve(0, evens - 1, odds);
}
if (odds != 0) {
ans += 5L * solve(0, evens, odds - 1);
}
if (first == 1 && evens == 1 && odds == 0) {
ans++;
}
return ans;
}
}
CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnV0aWwuKjsKCnB1YmxpYyBjbGFzcyBIb3dNYW55TnVtYmVycyB7CgoJc3RhdGljIEJ1ZmZlcmVkUmVhZGVyIGJyID0gbmV3IEJ1ZmZlcmVkUmVhZGVyKG5ldyBJbnB1dFN0cmVhbVJlYWRlcihTeXN0ZW0uaW4pKTsKCXN0YXRpYyBQcmludFdyaXRlciBvdXQgPSBuZXcgUHJpbnRXcml0ZXIobmV3IEJ1ZmZlcmVkT3V0cHV0U3RyZWFtKFN5c3RlbS5vdXQpKTsKCXN0YXRpYyBTdHJpbmdUb2tlbml6ZXIgc3QgPSBuZXcgU3RyaW5nVG9rZW5pemVyKCIiKTsKCglwdWJsaWMgc3RhdGljIFN0cmluZyBuZXh0KCkgewoJCXRyeQl7CgkJd2hpbGUgKCFzdC5oYXNNb3JlVG9rZW5zKCkpIHsKCQkJU3RyaW5nIHMgPSBici5yZWFkTGluZSgpOwoJCQlpZiAocyA9PSBudWxsKQoJCQkJcmV0dXJuIG51bGw7CgkJCXN0ID0gbmV3IFN0cmluZ1Rva2VuaXplcihzKTsKCQl9CgkJcmV0dXJuIHN0Lm5leHRUb2tlbigpOwoJCX0JY2F0Y2goRXhjZXB0aW9uIGUpCXsKCQkJcmV0dXJuCW51bGw7CgkJfQoJf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