cost basis on a partial stock sale

i am trying to  work out cost basis of a partial stock  sale.

Here is an example.

i bought 1 stock at $5

i bought same stock later and it was $10.

I bought same stock later and it was $15.

I now have 3 stocks.

 

i sold 1 of my 3 stocks for $20.

Forget LT v ST, assume they're all same.
Do i get to choose which cost basis to use for CG (in which case I'll pick the most expensive to  reduce my gain), or are there FIFO or LIFO rules on purchasing/sales?