Filling input with maximum number of available shares

The problem:

If the user has 5 available shares, and would like to sell those 5 shares, he'd have to input them manually in the below field. Some users have large amount of shares, and i'd like to make it easier to just have it fill out automatically.

Is there a standard way of approaching this problem? Initial thoughts is to have a checkbox that says something along the lines of "Maximum Number of Shares" and the input would automatically fill upon clicking that checkbox.

Curious to hearing your thoughts.

Number of Shares