A person can pay $6 for a membership to the history museum and the go to the museum for just $2 per visit. What is the maximum number of visits a member of the history museum can make for a total cost of $40?