Small Ramsey Numbers Background: the Ramsey number \$R(r,s)\$ gives the minimum number of vertices \$v\$ in the complete graph \$K_v\$ such that a red/blue edge coloring of \$K_v\$ has at least one red \$K_r\$ or one blue \$K_s\$. Bounds for larger \$r, s\$ are very difficult to establish. 

Your task is to output the number \$R(r,s)\$ for \$1 \le r,s \le 5\$.

Input

Two integers \$r, s\$ with \$1 \le r \le 5\$ and \$1 \le s \le 5 \$. 

Output

\$R(r,s)\$ as given in this table:

  s   1    2    3    4      5
r +--------------------------
1 |   1    1    1    1      1
2 |   1    2    3    4      5
3 |   1    3    6    9     14
4 |   1    4    9   18     25
5 |   1    5   14   25  43-48


Note that \$r\$ and \$s\$ are interchangeable: \$R(r,s) = R(s,r)\$. 

For \$R(5,5)\$ you may output any integer between \$43\$ and \$48\$, inclusive. At the time of this question being posted these are the best known bounds.
JavaScript (ES6), 51 49 bytes

Takes input in currying syntax (r)(s).

r=&gt;s=&gt;--r*--s+[9,1,,13,2,,3,27,6][r&lt;2|s&lt;2||r*s%9]


Try it online!

How?

As a first approximation, we use the formula:

$$(r-1)(s-1)$$

 0  0  0  0  0
 0  1  2  3  4
 0  2  4  6  8
 0  3  6  9 12
 0  4  8 12 16


If we have \$\min(r,s)&lt;3\$, we simply add \$1\$:

 1  1  1  1  1
 1  2  3  4  5
 1  3  -  -  -
 1  4  -  -  -
 1  5  -  -  -


Otherwise, we add a value picked from a lookup table whose key \$k\$ is defined by:

$$k=(r-1)(s-1)\bmod9$$

 k:                    table[k]:           (r-1)(s-1):         output:
 -  -  -  -  -         -  -  -  -  -       -  -  -  -  -       -  -  -  -  -
 -  -  -  -  -         -  -  -  -  -       -  -  -  -  -       -  -  -  -  -
 -  -  4  6  8   --&gt;   -  -  2  3  6   +   -  -  4  6  8   =   -  -  6  9 14
 -  -  6  0  3         -  -  3  9 13       -  -  6  9 12       -  -  9 18 25
 -  -  8  3  7         -  -  6 13 27       -  -  8 12 16       -  - 14 25 43