#include <iostream>
using namespace std;

int main() {
    int l, r;
    cin >> l >> r;
    int a, b;
    a = max(l, r);
    b = min(l, r);

    switch(a) {
    case 2:
        cout << 5;
        return 0;
    case 3:
        if (b == 2) cout << 19;
        else cout << 58;
        return 0;
    }
}
